HOST: https://dashboard.data-field.com/ --- Datafield API v1 --- --- **Remember that you need an API Key prior to being able to use the APIs.** To receive an API Key, please **contact us at contact@data-field.com** --- -- Get Token -- A token is mandatory to call an API successfully. The provided user must be an account admin. POST /apis/v1/tokens > Content-Type: application/json; charset=utf-8 > api-key: {API-KEY} { "email":"{EMAIL}", "password":"{PASSWORD}" } < 200 < Content-Type: application/json; charset=utf-8 { "token": "{TOKEN}" } -- Surveys -- ### Get Detail of Survey Get the details of a survey where you know the SurveyID GET /apis/v1/surveys/{id} > Content-Type: application/json; charset=utf-8 > api-key: {API-KEY} > Http-Auth-Token: {TOKEN} < 200 < Content-Type: application/json; charset=utf-8 { ... // Surveys detail } ### Get List of Surveys Get the list of Surveys for your account GET /apis/v1/surveys/ > Content-Type: application/json; charset=utf-8 > api-key: {API-KEY} > Http-Auth-Token: {TOKEN} < 200 < Content-Type: application/json; charset=utf-8 { ... // Survey list } ### Get Results of a Campaign Get results of a campaign GET /apis/v1/surveys/{id}/results?after={timestamp} > Content-Type: application/json; charset=utf-8 > api-key: {API-KEY} > Http-Auth-Token: {TOKEN} < 200 < Content-Type: application/json; charset=utf-8 { ... // Results } -- Users -- ### Create a user Create a user POST /apis/v1/users > Content-Type: application/json; charset=utf-8 > api-key: {API-KEY} > Http-Auth-Token: {TOKEN} { "email":"abc@data-field.com", "password":"123456", "firstname": "John", "lastname": "Doe", "teams": [1,2,3] } < 200 < Content-Type: application/json; charset=utf-8 { ... // Results } ### Details of a user Get details of a user GET /apis/v1/users/{id} > Content-Type: application/json; charset=utf-8 > api-key: {API-KEY} > Http-Auth-Token: {TOKEN} < 200 < Content-Type: application/json; charset=utf-8 { ... // Results } ### List users List users from an account GET /apis/v1/users > Content-Type: application/json; charset=utf-8 > api-key: {API-KEY} > Http-Auth-Token: {TOKEN} < 200 < Content-Type: application/json; charset=utf-8 { ... // Results } ### Update a user details Update the details of a user GET /apis/v1/users/{id} > Content-Type: application/json; charset=utf-8 > api-key: {API-KEY} > Http-Auth-Token: {TOKEN} { "email":"abc@data-field.com", "firstname": "John", "lastname": "Doe", "teams": [1,2,3] } < 200 < Content-Type: application/json; charset=utf-8 { ... // Results } ### Delete a user Delete a user DELETE /apis/v1/users/{id} > Content-Type: application/json; charset=utf-8 > api-key: {API-KEY} > Http-Auth-Token: {TOKEN} < 200 < Content-Type: application/json; charset=utf-8 { ... // Confirmation } -- Teams -- ### Create a team Create a team POST /apis/v1/teams > Content-Type: application/json; charset=utf-8 > api-key: {API-KEY} > Http-Auth-Token: {TOKEN} { "name": "staff", "members": [1,2,3] } < 200 < Content-Type: application/json; charset=utf-8 { ... // Confirmation } ### Get team details Get team details GET /apis/v1/teams/{id} > Content-Type: application/json; charset=utf-8 > api-key: {API-KEY} > Http-Auth-Token: {TOKEN} < 200 < Content-Type: application/json; charset=utf-8 { "name": "staff", "members": [1,2,3] } ### Update a team details Update team details GET /apis/v1/teams/{id} > Content-Type: application/json; charset=utf-8 > api-key: {API-KEY} > Http-Auth-Token: {TOKEN} { "name": "staff", "members": [1,2,3] } < 200 < Content-Type: application/json; charset=utf-8 { ... // Results } ### List teams in an account List teams in an account GET /apis/v1/teams > Content-Type: application/json; charset=utf-8 > api-key: {API-KEY} > Http-Auth-Token: {TOKEN} < 200 < Content-Type: application/json; charset=utf-8 { ... // Results } ### Delete a team Delete a team DELETE /apis/v1/teams/{id} > Content-Type: application/json; charset=utf-8 > api-key: {API-KEY} > Http-Auth-Token: {TOKEN} < 200 < Content-Type: application/json; charset=utf-8 { ... // Results }