Add an element
This endpoint allows you to add an element to an existing request. You can currently add docs, text and pages. form will come later.
Body
object
-
requestId
string Required -
type
string Required Type of the element. Can be docs, text and pages.
Values are
docs
,text
, orpages
. -
name
string Name of the element.
-
order
integer Order of the element on the portal. Order should be an integer and starts at 0.
Minimum value is
0
. -
description
string Description of the document that needs to be uploaded.
-
nickname
string A nickname for this element. Can be useful to classify your uploaded docs.
-
path
string A path for this element. Can be useful to classify your uploaded docs.
-
mandatory
boolean Is the document mandatory or not. Default is true.
-
extensions
array[string] A list of document extensions that are accepted. By default, all type of documents are accepted. Must be formated as a string like ['xls','xslx'].
-
multipleupload
boolean Specify if you are accepting multi documents for the same element. Default is true.
Responses
-
200 application/json
-
Bad Request -- Your request is invalid.
-
Unauthorized -- Your API key is wrong.
-
Forbidden -- The object requested is hidden for administrators only.
-
Not Found -- The specified object could not be found.
-
Too Many Requests -- You're requesting too many objects! Slow down!
-
Internal Server Error -- We had a problem with our server. Try again later.
-
Service Unavailable -- We're temporarily offline for maintenance. Please try again later.
curl \
--request POST 'https://api.usecollect.com/v1/elements' \
--header "Content-Type: application/json" \
--data '{"name":"ID","type":"docs","order":3,"requestId":"bbbBkrejSaJkHWwDE"}'
{
"name": "ID",
"type": "docs",
"order": 3,
"requestId": "bbbBkrejSaJkHWwDE"
}
{
"text": "Hello World!",
"type": "text",
"order": 4,
"requestId": "GTonevwqoPPJ2PYEy"
}
{
"name": "More details",
"type": "page",
"order": 2,
"requestId": "GTonevwqoPPJ2PYEy"
}
{
"id": "eEDJFD5unNQTHoSBZ",
"name": "ID",
"type": "docs",
"order": 3,
"itemId": "urRJfPK7CfyGBnHg8",
"status": "open",
"request": {
"_id": "bbbBkrejSaJkHWwDE",
"campaignId": "7gDq3XyLyixkhqoHa"
},
"uploads": [],
"mandatory": true,
"visibility": true,
"multipleupload": true
}
{
"id": "BKJ95xmpHSyo7KuRC",
"name": "Text block",
"text": "Hello World!",
"type": "text",
"order": 4,
"itemId": "7LBBC8LwnBnQoz8ae",
"request": {
"_id": "GTonevwqoPPJ2PYEy",
"campaignId": "3ya2sjN9GYwYAHeSi"
},
"visibility": true
}
{
"id": "XigRzPs4N5vwX3Rks",
"name": "More details",
"type": "page",
"order": 2,
"itemId": "L3uAmzDRJjWTm2TMR",
"request": {
"_id": "GTonevwqoPPJ2PYEy",
"campaignId": "3ya2sjN9GYwYAHeSi"
},
"visibility": true
}