Skip to main content
Skip table of contents

[Integrations] Create an Object

Request

  • HTTP URL : https://<your-instance>.yooi.io/api/store/object

  • HTTP method: POST

  • HTTP body : a JSON document representing the object to create

Response

JSON
{
 "eventId":{EVENT ID}, // unique event identifier for the creation3 "objectId":{CREATED OBJECT ID}, // id of the created object4 "key":{CREATED OBJECT ID}
}

Example

Create a country

To create the country France we need to specify that it is:

  1. An instance of Country 

    • Instance of field ID : "a3a4f8d2-8f88-4398-99b9-37546ec9dfc1" 

  2. It's name is France 

    • Name field ID : RIchText(France)

  3. It's population is 60000000

    1. Country population field ID: 60000000

BASH
curl -X 'POST' \
 'https://<your-instance>.yooi.io/api/store/object' \
 -H 'Authorization: Bearer yt_secret_ptAXBTZ38DzVeAR5rrl1y0S5AAUWbl0c' \
 -H 'Content-Type: application/json' \
 -d '{"ee3b77dc-4172-5aae-add8-627a43b06783": "a3a4f8d2-8f88-4398-99b9-37546ec9dfc1", "bf040b6b-58be-5194-8f32-4e1c8df24b42": [{"type": "paragraph","children": [{"text": "France"}]}],"ae94d0af-526c-458f-b522-7d5653bc492d": 6000000018  }'

The result of the API call contains the event ID, the created object ID and key.

If you can’t see the instance you just created in YOOI, you may have forgotten to assign rights to View concept instances

JSON
{
  "eventId": "1632752769966-0",
  "objectId": "936793b5-ca4a-481d-8dcd-756221937e95",
  "key": "936793b5-ca4a-481d-8dcd-756221937e95"
}

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.