The Form Service purpose is to provide templates of forms that describes the content, behavior and structure which a client can consume.
The Form Service is a RESTful API that allows you to create, update, read and delete (not implemented yet) Form templates.
Read the global requirements for this repo, can be found here
A running instance of a API GATEWAY on AWS that includes a gateway resource named /forms. You can find and deploy this in our resource repository.
A running instance of a DYNAMODB. You can find and deploy this in our resource repository.
$ npm install
$ sls offline
When you deploy the service, serverless will output the generated url in the terminal that the service can be accessed from.
Deploy command:
$ sls deploy -v
When you deploy the service, serverless will output the generated url in the terminal that the service can be accessed from.
GET
/forms
{
"jsonapi": {
"version": "1.0"
},
"data": [
{ form1 },
{ form2 },
...
]
}
GET
/forms/{id}
{
"jsonapi": {
"version": "1.0"
},
"data": [
{
"description": "A nice form",
"id": "c04d7b00-c1eb-11ea-8e48-57bbdcb70948",
"PK": "FORM#c04d7b00-c1eb-11ea-8e48-57bbdcb70948",
"name": "Form Name"
"updatedAt": 1594302887600,
"createdAt": 1594302887600,
"steps": [
{
"title": "first step",
"description": "A good beginning"
"questions": [
{
"type": "text",
"id": "123123",
"label": "Good stuff"
}
],
}
],
}
]
}
POST
/forms
{
"description": "A nice form",
"name": "Form Name",
"steps": [
{
"title": "first step",
"description": "A good beginning",
"questions": [
{
"type": "text",
"id": "123123",
"label": "Good stuff"
}
]
}
]
}
{
"jsonapi": {
"version": "1.0"
},
"data": {
"Item": {
"id": "c04d7b00-c1eb-11ea-8e48-57bbdcb70948",
"PK": "FORM#c04d7b00-c1eb-11ea-8e48-57bbdcb70948",
"createdAt": 1594302887600,
"updatedAt": 1594302887600,
"steps": [
{
"title": "first step",
"description": "A good beginning",
"questions": [
{
"id": "123123",
"type": "text",
"label": "Good stuff"
}
]
}
],
"description": "A nice form",
"name": "Form Name"
}
}
}
PUT
/forms/{formId}
{
"description": "A nice form",
"name": "Form Name"
"steps": [
{
"title": "first step",
"description": "A good beginning"
"questions": [
{
"type": "text",
"id": "newId",
"label": "newLabel"
},
{
"type": "number",
"id": "newId",
"label": "newLabel"
}
],
}
],
}
{
"jsonapi": {
"version": "1.0"
},
"data": {
"Item": {
"id": "c04d7b00-c1eb-11ea-8e48-57bbdcb70948",
"PK": "FORM#c04d7b00-c1eb-11ea-8e48-57bbdcb70948",
"createdAt": 1594302887600,
"updatedAt": 1594302887600,
"steps": [
{
"title": "first step",
"description": "A good beginning"
"questions": [
{
"type": "text",
"id": "newId",
"label": "newLabel"
},
{
"type": "number",
"id": "newId",
"label": "newLabel"
}
],
}
],
"description": "A nice form",
"name": "Form Name"
}
}
}
DELETE
/forms/{id}
{
"jsonapi": {
"version": "1.0"
},
"data": {}
}