This tutorial demonstrates how to save a contact via the RESTful API.
The steps include:
Getting the Job ID
Saving a contact in the server
The commands are provided in curl and can be run from the command prompt when the 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 save a contact.
Click in the line below to see the code.
Sample Request
{
"ID": {
"_id": 1, // this is the job id
"_server_id": 1,
"_server_guid": "b993c729-bf98-490c-989d-5621e3b48139",
"IDString": "1_1"
},
"FirstName": "post",
"LastName": "man",
"Email": "postman@gmail.com",
"SignatureImage": "string",
"Companies": [],
"Attributes": []
}
Additionally, if you want to include a company and attributes to the contact, you can include them in the Companies and Attributes field in the request.
Click in the line below to see the code.
Sample Request with Company and Attributes
{
"ID": {
"_id": 1,
"_server_id": 1,
"_server_guid": "b993c729-bf98-490c-989d-5621e3b48139",
"IDString": "1_1"
},
"FirstName": "post",
"LastName": "man",
"Email": "postman@gmail.com",
"SignatureImage": "string",
"Companies": [
{
"id": { // this is the company id
"_id": 1,
"_server_id": 1,
"_server_guid": "b993c729-bf98-490c-989d-5621e3b48139",
"IDString": "1_1"
},
"name": "string",
"created_by": {
"_id": 0,
"_server_id": 0,
"_server_guid": "b993c729-bf98-490c-989d-5621e3b48139",
"IDString": "string"
},
"create_date": "2025-04-06T23:34:56.863Z",
"updated_date": "2025-04-06T23:34:56.863Z",
"attributes": [],
"active": true
}
],
"Attributes": [
{
"type": 0,
"optional": true,
"enum_items": [
{
"visibility_constraint": {
"constraint": "string",
"id": 0,
"name": "string"
},
"enum_id": {
"_id": 0,
"_server_id": 0,
"_server_guid": "00000000-0000-0000-0000-000000000000",
"IDString": "string"
},
"value": "string",
"display_name": "string",
"hidden": true,
"id": {
"_id": 0,
"_server_id": 0,
"_server_guid": "00000000-0000-0000-0000-000000000000",
"IDString": "string"
}
}
],
"value": {},
"description": "string",
"read_only": true,
"input_mask": "string",
"is_auto_increment": true,
"auto_increment_start": 0,
"order": 0,
"visibility_constraint": {
"constraint": "string",
"id": 0,
"name": "string"
},
"is_visible": true,
"reprompt_on_change": true,
"workflow_id": {
"_id": 0,
"_server_id": 0,
"_server_guid": "00000000-0000-0000-0000-000000000000",
"IDString": "string"
},
"attribute_id": {
"_id": 0,
"_server_id": 0,
"_server_guid": "00000000-0000-0000-0000-000000000000",
"IDString": "string"
},
"id": {
"_id": 0,
"_server_id": 0,
"_server_guid": "00000000-0000-0000-0000-000000000000",
"IDString": "string"
},
"name": "string",
"display_name": "string''
}
]
}
A successful response would look like this.
{
"_id": 1,
"_server_id": 1,
"_server_guid": "b993c729-bf98-490c-989d-5621e3b48139",
"IDString": "1_1"
}