Skip to content
View Categories

Creating Objects

Table of Contents

In this section, we’re going to Create a contact.person Object in your Data Store. Refer to the relevant documentation for the Objects for more information about the fields contained within the Object.

To Create an Object, we need to use the POST HTTP method to send data to the Objects action API end-point.

ParameterDescription
objectThe Object that you want to create – e.g., contacts.person
dataFieldsA JSON collection containing the field values you want to set. Refer to the documentation for the specific Object for information on the fields that are available, their data types and which ones are mandatory.
JSON Payload Parameters

Request:
POST: https://api.spacetagcloud.net/objects/v1/action

Headers:
x-spacetag-app-uuid: 0b8d10be-87 ...
x-api-key: bca011a6-9375-11 ...

Content-Type: application/json

Body:

{
    "object": "contacts.person",
    "dataFields": {
        "first_name": "Matthew",
        "last_name": "Poole",
        "city": "Salisbury",
        "country_code": "GBR",
        "position": "CEO & Founder",
        "status": "Test"
    }
}

Using Postman #

In Postman it would look like this, based on the set-up in the previous sections.

If the request is successful then the API will respond with a 200 OK status and the following data:

The newUUID field is the unique identifier of the Object that has just been created. You can use this to reference the Object whenever you need to going forward. There are also a number of other ways you can get your Objects back which are explained in later sections.

Using Curl #

This is an example of how you would create an Object using a command-line utility such as Curl.

curl -X POST -H "x-spacetag-app-uuid: 0b8d10be-87 ..." -H "x-api-key: bca011a6-9375-11 ..." -H "Content-Type: application/json" -d '{"object": "contacts.person", "dataFields": {"first_name": "Matthew", "last_name": "Poole", "city": "Salisbury", "country_code": "GBR", "position": "CEO & Founder", "status": "Test"} }' https://api.spacetagcloud.net/objects/v1/action