|
Create a Form.
/forms
The request body is a JSON representation of the Form being created.
Create a form with 3 fields.
POST https://api.swiftapp.com/v1/forms POST DATA
|
{ "id":"99", "name":"Dangerous Speech Categorisation", "fields":[ { "id":"23", "title":"Language", "description":"Language the audience is being addressed in", "type":"mutiple", "required":false, "options":[ "English", "Swahili", "Luo", "Kalenjin", "Luhya", "Kikuyu", "Sheng", "Other" ] }, { "id":"24", "title":"Speaker", "description":"Description of the speaker", "type":"select", "required":false, "options":[ "Politician", "Journalist", "Blogger", "Community Leader", "Anonymous Commenter", "Identifiable Commenter", "Public Figure" ] }, { "id":"25", "title":"Target Audience", "description":"Audience most likely to react to this statement/article", "type":"text", "required":true } ] } |
Returns the Form with the given :id
.
/forms/:id
Name |
Type |
Description |
---|---|---|
id |
Required |
The identifier for the desired form. |
|
{ "id":"1234", "name":"Dangerous Speech categorisation", "fields":[ { "id":"13", "title":"Language", "description":"Language the audience is being addressed in", "type":"mutiple", "required":false, "options":[ "English", "Swahili", "Luo", "Kalenjin", "Luhya", "Kikuyu", "Sheng", "Other" ] }, { "id":"14", "title":"Speaker", "description":"Description of the speaker", "type":"select", "required":false, "options":[ "Politician", "Journalist", "Blogger", "Community Leader", "Anonymous Commenter", "Identifiable Commenter", "Public Figure" ] }, { "id":"15", "title":"Target Audience", "description":"Audience most likely to react to this statement/article", "type":"text", "required":true } ] } |
Modify an existing form. Fields cannot be modified from this end point and can only be modified via the field endpoints.
/forms/:id
The request body is a JSON representation of the Form being updated.
Rename a form.
PUT https://api.swiftapp.com/v1/forms/1234 PUT DATA
|
{ "id":"1234", "name":"Form Renamed", "fields":[ { "id":"13", "title":"Language", "description":"Language the audience is being addressed in", "type":"mutiple", "required":false, "options":[ "English", "Swahili", "Luo", "Kalenjin", "Luhya", "Kikuyu", "Sheng", "Other" ] }, { "id":"14", "title":"Speaker", "description":"Description of the speaker", "type":"select", "required":false, "options":[ "Politician", "Journalist", "Blogger", "Community Leader", "Anonymous Commenter", "Identifiable Commenter", "Public Figure" ] }, { "id":"15", "title":"Target Audience", "description":"Audience most likely to react to this statement/article", "type":"text", "required":true } ] } |
Delete a form.
/forms/:id
Field |
Type |
Description |
---|---|---|
id |
Required |
The identifier for the desired form |
|
Add a new Field to a form.
/forms/:id/fields
The request body is a JSON representation of the Field being added.
Field |
Type |
Description |
---|---|---|
id |
Required |
The identifier for the desired form |
POST https://api.swiftapp.com/v1/forms/9999/fields POST DATA
|
{ "id":"4321", "title":"Event", "description":"The event the statement is associated with", "type":"text", "required":false, } |
Modify a field.
/forms/:id/fields/:field_id
The request body is a JSON representation of the Field being modified.
Field |
Type |
Description |
---|---|---|
id |
Required |
The numerical id of the desired form |
field_id |
Required |
Account id of the field |
Below request makes a previously optional field, mandatory.
PUT https://api.swiftapp.com/v1/forms/9999/fields/4321 PUT DATA
|
{ "id":"4321", "title":"Event", "description":"The event the statement is associated with", "type":"text", "required":true, } |
Remove an existing account field. Only form owners can perform this action.
/forms/:id/fields/:field_id
Field |
Type |
Description |
---|---|---|
id |
Required |
Identified for the the desired form. |
field_id |
Required |
Identified for the field. |
DELETE https://api.swiftapp.com/v1/forms/9999/fields/345 |