Add an element

POST /elements

This endpoint allows you to add an element to an existing request. You can currently add docs, text and pages. form will come later.

application/json

Body object

One of:

Responses

  • 200 application/json
    One of:
  • 400

    Bad Request -- Your request is invalid.

  • 401

    Unauthorized -- Your API key is wrong.

  • 403

    Forbidden -- The object requested is hidden for administrators only.

  • 404

    Not Found -- The specified object could not be found.

  • 429

    Too Many Requests -- You're requesting too many objects! Slow down!

  • 500

    Internal Server Error -- We had a problem with our server. Try again later.

  • 503

    Service Unavailable -- We're temporarily offline for maintenance. Please try again later.

POST /elements
curl \
 -X POST https://api.usecollect.com/v1/elements \
 --user "username:password" \
 -H "Content-Type: application/json" \
 -d '{"requestId":"bbbBkrejSaJkHWwDE","type":"docs","name":"ID","order":3}'
Request examples
{
  "requestId": "bbbBkrejSaJkHWwDE",
  "type": "docs",
  "name": "ID",
  "order": 3
}
{
  "requestId": "GTonevwqoPPJ2PYEy",
  "type": "text",
  "order": 4,
  "text": "Hello World!"
}
{
  "requestId": "GTonevwqoPPJ2PYEy",
  "type": "page",
  "order": 2,
  "name": "More details"
}
Response examples (200)
{
  "id": "eEDJFD5unNQTHoSBZ",
  "itemId": "urRJfPK7CfyGBnHg8",
  "name": "ID",
  "order": 3,
  "visibility": true,
  "status": "open",
  "mandatory": true,
  "multipleupload": true,
  "uploads": [],
  "type": "docs",
  "request": {
    "_id": "bbbBkrejSaJkHWwDE",
    "campaignId": "7gDq3XyLyixkhqoHa"
  }
}
{
  "id": "BKJ95xmpHSyo7KuRC",
  "itemId": "7LBBC8LwnBnQoz8ae",
  "name": "Text block",
  "order": 4,
  "visibility": true,
  "type": "text",
  "text": "Hello World!",
  "request": {
    "_id": "GTonevwqoPPJ2PYEy",
    "campaignId": "3ya2sjN9GYwYAHeSi"
  }
}
{
  "id": "XigRzPs4N5vwX3Rks",
  "itemId": "L3uAmzDRJjWTm2TMR",
  "name": "More details",
  "order": 2,
  "visibility": true,
  "type": "page",
  "request": {
    "_id": "GTonevwqoPPJ2PYEy",
    "campaignId": "3ya2sjN9GYwYAHeSi"
  }
}