Add an external service to asset.
Where:
-
name and endpoint are required
-
active is True by default
-
export_type must be one of these values:
- json (default)
- xml
-
email_notification is a boolean. If true, User will be notified when request to remote server has failed.
-
auth_level must be one of these values:
- no_auth (default)
- basic_auth
-
subset_fields is the list of fields of the form definition. Only these fields should be present in data sent to remote server
-
settings.custom_headers is dictionary of custom header: value
For example:
"settings": {
"customer_headers": {
"Authorization" : "Token 1af538baa9045a84c0e889f672baf83ff24"
}
- payload_template is a custom wrapper around %SUBMISSION% when sending data to remote server. It can be used only with JSON submission format.
For example:
"payload_template": '{"fields": %SUBMISSION%}'
Request
- The document declares no server URL.
- Auth: one of:
- HTTP basic
- API key in header Authorization
Path parameters
UID of the parent assets
Request body
Example request
{
"logs_url": "https://kf.kobotoolbox.org/api/v2/assets/a3C9wWefqZVkChNLKqqXVZ/hooks/hZzzeedWxQoFHgibsTCysv/logs/",
"url": "https://kf.kobotoolbox.org/api/v2/assets/a3C9wWefqZVkChNLKqqXVZ/"
}Response
Example response
{
"logs_url": "https://kf.kobotoolbox.org/api/v2/assets/a3C9wWefqZVkChNLKqqXVZ/hooks/hZzzeedWxQoFHgibsTCysv/logs/",
"url": "https://kf.kobotoolbox.org/api/v2/assets/a3C9wWefqZVkChNLKqqXVZ/"
}Changes
- breaking
the request property
became not nullable (media type: application/json) - breaking
the request property
became not nullable (media type: application/x-www-form-urlencoded) - breaking
the request property
became not nullable (media type: multipart/form-data)
- breaking
- breaking
removed the required property
from the response with the status
- breaking