Get Contacts

Prev Next

This tutorial demonstrates how to get contacts via the RESTful API.

The steps include:

  • Getting the Job ID

  • Using Job ID to get the contacts

The commands are provided in curl and can be run from the command prompt when the 12d Synergy Server is running (or in a batch script).

Additional API documentation

To get a list of most of the API requests available, with the 12d Synergy server running, browse http://synergy.myserver.com/api-docs/ui/index.

(Replace synergy.myserver.com with the external server address and update the port numbers if necessary.)

1.1. Getting the Personal Access Token to access API

The tutorial for getting the PAT is here: Generate PAT in Web client.

1.2. Getting the Job ID

Refer to Search Jobs to look for the required job.

Once the Job ID is retrieved, you can use that in the request to get the contacts.

The parameters retrieve_attributes and retrieve_companies are optional. Once set to true, it will include attributes and companies in the response; otherwise, it will be null.

Sample Request
curl --location 'http://synergy.myserver.com/api/v1/contacts/{job-id-here}?retrieve_attributes=true&retrieve_companies=true' \

--header 'Authorization: Bearer <token-here>' \

--header 'Content-Type: application/json'
Sample Response
{

    "id": {

        "_id": 1,

        "_server_id": 1,

        "_server_guid": "b993c729-bf98-490c-989d-5621e3b48139",

        "IDString": "1_1"

    },

    "is_user": true,

    "companies": [],

    "first_name": "Test",

    "last_name": "User",

    "email": "Test.User@test.com",

    "active": true,

    "create_date": "2024-12-10T01:48:00.25",

    "attributes": [],

    "image_modified_date_time": "2024-12-10T01:48:03.23"

}