Introduction to Automizy REST API
Headers
Authentication headers
Field | Type | Description |
---|---|---|
Api-key | String | Api token |
Content-Type | String | Request content type |
Accept | String | Response content type |
{ "Content-Type": "application/json", "Accept": "application/json" }
Authentication
Getting access token
Each token grants access to the company account it was created in.
Example of creating a new access token:
- You log in to Automizy using 'your.email@email.com'.
- If you have access to multiple company accounts, you select the account you want to create the token for, for example 'Your Company Inc.'
- You click on Settings menu in the bottom-left corner.
- You click on 'API Token' menu.
-
You can see the tokens you already generated.
Click on 'New Token' to generate a new one. -
A dialog with the new token shows up.
Copy and save the generated token, because you won't be able to check it again after closing the dialog.
From you on, you can use this token to send requests to Automizy to manage account 'Your Company Inc.' on behalf of user 'your.email@email.com' using the Api-key: <ACCESS TOKEN>
header as shown in the examples.

Contacts
Creating a new contact
Please find the documentation about contact creation here.
Getting all contacts
Please find the documentation about getting all contacts here.
Get a contact
https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/contact/:id
Request data
Path variables
Field | Required | Description | Type | Default | Example |
---|---|---|---|---|---|
id | true | The Contact id you want to get | number | - | 1 |
Example
Call
fetch('https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/contact/123', { method: 'GET', headers: { 'Api-key': '<TOKEN>', 'Content-Type': 'application/json' }, });
Returns
- The contacts data
200 OK
{ "id":1, "emailAddress":"example@automizy.com", "status":"ACTIVE", "createdAt":"2021-10-14T09:05:56.000Z", "unsubscribeDate":null, "ipAddress":null, "tags":[ {"id":1,"name":"Tag1"}, {"id":2,"name":"Tag2"} ], "lists":[ {"id":1,"name":"List1"}, {"id":2,"name":"List2"} ], "fields":[ { "id":1, "mergeTag":"mergeTag", "label":"label", "isShownOnModificationForm":false, "type":"STRING", "defaultValue":null, "value":"field1" }, { "id":2, "mergeTag":"mergeTag1", "label":"label1", "isShownOnModificationForm":false, "type":"STRING", "defaultValue":"default value", "value":"field2" } ] }
- If the Contact not exist
404 Not Found
{ "error": "Contact not exist", "id": 123 }
- If invalid data passed
422 Unprocessable Entity
{ "errors": [ { "id": "\"id\" must be a number" } ] }
IMPORT STEP 1 - Analyze import
https://api.automizy-gateway-1.com/import-service-http/public/api/import-service/analyze
Request data
File
Field | Required | Description | Type | Default | Example |
---|---|---|---|---|---|
file | true | The csv file you want to parse | .csv | - |
Example
Call
fetch('https://api.automizy-gateway-1.com/import-service-http/public/api/import-service/analyze', { method: 'POST', headers: { 'Api-key': '<TOKEN>', 'Content-Type': 'multipart/form-data' }, body: file });
Returns
- An object includes the importId and the CSV headers
200 OK
{ "importId": 123, "headers": ["header1", "header2", "header3"] }
- If no file passed
500 Internal server error
Internal server error
IMPORT STEP 2 - Process an import
https://api.automizy-gateway-1.com/import-service-http/public/api/import-service/:importId/process
Request data
Path variables
Field | Required | Description | Type | Default | Example |
---|---|---|---|---|---|
importId | true | The Import id you want to import, received from the Analyze step | number | - | 1 |
Body
Field | Required | Description | Type | Default | Example |
---|---|---|---|---|---|
contactListIdList | true | List of contact list ids | array | - | [1,3,4] |
overwrite | true | Whether information in the csv should overwrite contact data should the contact exist | bool | - | false |
fieldList | true | Mapping of field ids with the corresponding csv header, the "EmailAddress" field has null as "fieldId" with "ignore: false" | array | - | [{"fieldId": 1, "headerName": "asd", "ignore": false},{"fieldId": 2,"headerName": "wqerew", "ignore": false}] |
addContactTagIdList | true | List of contact tag ids you want to put on contacts | array | - | [23, 45] |
removeContactTagIdList | true | List of contact tag ids you want to remove from contacts | array | - | [78, 32] |
notificationEmailAddress | false | Notification email where message will be sent upon import completion, if not present it will be retrieved from token | string | - | "asd@asd.com" |
Example
Call
fetch('https://api.automizy-gateway-1.com/import-service-http/public/api/import-service/import/:id/process', { method: 'POST', headers: { 'Api-key': '<TOKEN>', 'Content-Type': 'application/json' }, body: JSON.stringify({ contactListIdList: [1], overwrite: false, fieldList: [ { fieldId: 1, headerName: 'header1', ignore: false, }, { fieldId: 2, headerName: 'header2', ignore: false, }, { fieldId: null, headerName: 'header3', ignore: false, }, { fieldId: null, headerName: 'header4' ignore: true, }], addContactTagIdList: [1, 2], removeContactTagIdList: [3], notificationEmailAddress: 'example@automizy.com' }) });
Returns
- An object with a success key
200 OK
{ "success": true }
- If invalid data passed
422 Unprocessable Entity
{ "errors": [ { "notificationEmailAddress": "\"notificationEmailAddress\" is required" } ] }
Delete a contact
https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/contact/:id
Request data
Path variables
Field | Required | Description | Type | Default | Example |
---|---|---|---|---|---|
id | true | The contacts id you want to delete | number | - | 1 |
Example
Call
fetch('https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/contact/123', { method: 'DELETE', headers: { 'Api-key': '<TOKEN>', 'Content-Type': 'application/json' } });
Returns
- An object with a success key
200 OK
{ "success": true }
- If invalid data passed
422 Unprocessable Entity
{ "errors": [ { "field": "id", "message": "\"id\" must be a number" } ] }
- If the contact does not exist
404 Not Found
{ "message": "Contact not exist", "path": "https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/contact/1" }
Update a contact's status
https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/contact/:id/status
Request data
Path variables
Field | Required | Description | Type | Default | Example |
---|---|---|---|---|---|
id | true | The contacts id, you want to update | number | - | 1 |
Body
Field | Required | Description | Type | Default | Example |
---|---|---|---|---|---|
status | true | The new status of the contact | string, oneof: [ 'ACTIVE', 'UNSUBSCRIBED', 'BOUNCED' ] | - | 'BOUNCED' |
Example
Call
fetch('https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/contact/123/status', { method: 'PATCH', headers: { 'Api-key': '<TOKEN>', 'Content-Type': 'application/json' }, body: JSON.stringify({ status: 'UNSUBSCRIBED' }) });
Returns
- An object with a success key
200 OK
{ "success": true }
- If invalid data passed
422 Unprocessable Entity
{ "errors": [ { "field": "id", "message": "\"id\" must be a number" } ] }
- If the contact does not exist
404 Not Found
{ "message": "Contact not exist", "path": "https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/contact/1/status" }
Update a contact's email address
https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/contact/:id/email-address
Request data
Path variables
Field | Required | Description | Type | Default | Example |
---|---|---|---|---|---|
id | true | The contacts id, you want to update | number | - | 1 |
Body
Field | Required | Description | Type | Default | Example |
---|---|---|---|---|---|
emailAddress | true | The new email address of the contact | string | - | newemailaddress@asd.com |
Example
Call
fetch('https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/contact/123/email-address', { method: 'PATCH', headers: { 'Api-key': '<TOKEN>', 'Content-Type': 'application/json' }, body: JSON.stringify({ emailAddress: 'newemailaddress@asd.com' }) });
Returns
- An object with a success key
200 OK
{ "success": true }
- If invalid data passed
422 Unprocessable Entity
{ "errors": [ { "field": "id", "message": "\"id\" must be a number" } ] }
- If a contact with the same email address for account already exist
409 Conflict
{ "message": "Contact already exist", "path": "https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/contact/1/email-address" }
- If the contact does not exist
404 Not Found
{ "message": "Contact not exist", "path": "https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/contact/1/email-address" }
Update a contact's tags
https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/contact/:id/tag
Request data
Path variables
Field | Required | Description | Type | Default | Example |
---|---|---|---|---|---|
id | true | The Tag id you want to update | number | - | 1 |
Body
Field | Required | Description | Type | Default | Example |
---|---|---|---|---|---|
tagNameList | true | Array of tag names | array | - | ["new", "tag"] |
Example
Call
fetch('https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/contact/123/tag', { method: 'POST', headers: { 'Api-key': '<TOKEN>', 'Content-Type': 'application/json' }, body: JSON.stringify({ "tagNameList": ["new", "tag"] }) });
Returns
- An object with a success key
200 OK
{ "success": true }
- If invalid data passed
422 Unprocessable Entity
{ "errors": [ { "id": "\"id\" must be a number" }, { "tagNameList": "\"tagNameList\" must be an array" } ] }
- If contact not exist
404 Not Found
{ "message": "Contact not exist", "path": "https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/contact/123/tag" }
Update a contact's field values
https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/contact/:id/field
Request data
Path variables
Field | Required | Description | Type | Default | Example |
---|---|---|---|---|---|
id | true | The Contacts id you want to update | number | - | 1 |
Body
Field | Required | Description | Type | Default | Example |
---|---|---|---|---|---|
fieldId | true | The id of the field you want to update | number | - | 123 |
value | true | The new value of the field | string | - | "new value" |
Example
Call
fetch('https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/contact/123/field', { method: 'POST', headers: { 'Api-key': '<TOKEN>', 'Content-Type': 'application/json' }, body: JSON.stringify({ fieldId: 1, value: "new value" }) });
Returns
- An object with a success key
200 OK
{ "success": true }
- If the Contact not exist
404 Not Found
{ "message": "Contact not exist", "path": "https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/contact/43/field" }
- If the Field not exist
404 Not Found
{ "message": "Field not exist", "path": "https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/contact/43/field" }
- If invalid data passed
422 Unprocessable Entity
{ "errors": [ { "id": "\"id\" must be a number" }, { "name": "\"name\" must be a string" } ] }
Lists
Currently in Automizy you can't create a contact that doesn't belong to at least one list.
Create a list
https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/list
Request data
Body
Field | Required | Description | Type | Default | Example |
---|---|---|---|---|---|
name | true | The name of the new list | string | - | "My Template" |
Example
Call
fetch('https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/list', { method: 'POST', headers: { 'Api-key': '<TOKEN>', 'Content-Type': 'application/json' }, body: JSON.stringify({ name:"List" }) });
Returns
- An object includes the created list id
200 OK
{ "id": 123, "name": "List" }
- If invalid data passed
422 Unprocessable Entity
{ "errors": [ { "name": "\"name\" is required" } ] }
- If no data passed
422 Unprocessable Entity
{ "errors": [ { "message": "'name' parameter required." } ] }
Create a contact on a list
https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/contact
Request data
Body
Field | Required | Description | Type | Default | Example |
---|---|---|---|---|---|
emailAddress | true | The emailAddress of the contact | string | - | example@automizy.com |
listId | true | The id of the list we want to add the contact to | number | - | 1 |
fields | false | The fields we want to add to the contact | [{ id, value }] | - | [ {id: 1, value: 'fieldValue1'} ] |
Example
Call
fetch('https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/contact', { method: 'POST', headers: { 'Api-key': '<TOKEN>', 'Content-Type': 'application/json' }, body: JSON.stringify({ emailAddress: 'example@automizy.com', listId: 1, fields: [ { id: 1, value: 'value1' }, { id: 2, value: 'value2' } ] }) })
Returns
- An object includes the created Contacts id
200 OK
{ "id": 123 }
- If not existing list passed
404 Not Found
{ "message": "Contact List not exist" }
- If not existing field passed
404 Not Found
{ "message": "Field not exist" }
- If invalid data passed
422 Unprocessable Entity
{ "errors": [ { "emailAddress": "\"emailAddress\" is required" } ] }
Get a list
https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/list/:id
Request data
Path variables
Field | Required | Description | Type | Default | Example |
---|---|---|---|---|---|
id | true | The list id you want to get | number | - | 1 |
Example
Call
fetch('https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/list/123', { method: 'GET', headers: { 'Api-key': '<TOKEN>', 'Content-Type': 'application/json' }, });
Returns
- a list object
200 OK
{ "id": 123, "name": "List", "createdAt": "2021-12-03T16:49:24.328Z", "updatedAt": "2021-12-03T16:49:24.328Z", "contactCount": 0 }
- If the List not exist
404 Not Found
{ "message": "Contact List not exist", "path": "https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/list/43" }
- If invalid data passed
422 Unprocessable Entity
{ "errors": [ { "field": "id", "message": "\"id\" must be a number" } ] }
- If no data passed
422 Unprocessable Entity
{ "errors": [ { "field": "id", "message": "\"id\" must be a number" } ] }
Get a list of lists
/api/contact-manager/list
Request data
Query params
Field | Required | Description | Type | Default | Example |
---|---|---|---|---|---|
page | false | The n-th page you want to get | number | - | 1 |
pageSize | false | The size of the selection | number | - | 10 |
Example
Call
fetch('https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/list?' + new URLSearchParams({ page:1, pageSize:10 }), { method: 'GET', headers: { 'Api-key': '<TOKEN>', 'Content-Type': 'application/json' } });
Returns
- An array includes list objects
200 OK
{ "totalItems": 2, "totalPages": 1, "currentPage": 1, "items": [ { "id": 1, "name": "List1", "createdAt": "2021-10-14T13:40:57.000Z", "updatedAt": "2021-10-14T13:40:57.000Z", "contactCount": 1 }, { "id": 2, "name": "List2", "createdAt": "2021-10-14T13:49:29.000Z", "updatedAt": "2021-10-14T13:49:29.000Z", "contactCount": 1 } ] }
- If the list is empty
200 OK
{ "totalItems": 0, "totalPages": 0, "currentPage": 0, "items": [] }
- If invalid data passed
422 Unprocessable Entity
{ "errors": [ { "field": "page", "message": "\"page\" must be a number" } ] }
Get all contacts from a list
https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/list
Request data
Query params
Field | Required | Description | Type | Default | Example |
---|---|---|---|---|---|
page | false | The n-th page you want to get | number | - | 1 |
pageSize | false | The size of the selection | number | - | 10 |
Body
Field | Required | Description | Type | Default | Example |
---|---|---|---|---|---|
scope | true | The search params | object | - | {listId: 1, search: { operator: 'IS', value: 'field 21' }} |
criterion | true | The filter criteria object array | [[{}, {}],[{}, {}]] | - |
Example
Call
fetch('https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/contact/criterion' + new URLSearchParams({ page:1, pageSize:10 }), { method: 'POST', headers: { 'Api-key': '<TOKEN>', 'Content-Type': 'application/json' }, body: JSON.stringify({ scope: { listId: 123, search: { operator: "IN", value: "automizy" }, contactStatus: "ACTIVE" }, criterion: [ [ { type: "IMPORT", operator: "EQ", value: 456 }, { type: "FIELD", operator: "IN", fieldId: 3 value: "Programmer" } ] ] }) });
Returns
- An array includes Contacts matching the criterion, calculated by the contact filter and the scope.
200 OK
{ "totalItems":9, "totalPages":1, "currentPage":1, "items":[ { "id":3, "emailAddress":"example@automizy.com", "status":"ACTIVE", "createdAt":"2021-10-18T11:59:43.000Z", "tags":[ { "id":2, "name":"Tag2" }, { "id":1, "name":"Tag1" } ], "fields":[ { "id":1, "mergeTag":"firstname", "label":"first name", "defaultValue":null, "value":"field1" }, { "id":2, "mergeTag":"lastname", "label":"last name", "defaultValue":"default value", "value":"field2" } ] } ] }
- If the list is empty
200 OK
{ "totalItems": 0, "totalPages": 0, "currentPage": 0, "items": [] }
- If invalid data passed
422 Unprocessable Entity
{ "errors": [ { "field": "page", "message": "\"page\" must be a number" } ] }
Delete a list
https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/list/:id
Request data
Path variables
Field | Required | Description | Type | Default | Example |
---|---|---|---|---|---|
id | true | The list id you want to delete | number | - | 1 |
Example
Call
fetch('https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/list/123', { method: 'DELETE', headers: { 'Api-key': '<TOKEN>', 'Content-Type': 'application/json' } });
Returns
- An object with a success key
200 OK
{ "success": true }
- If the list does not exist
404 Not Found
{ "message": "Contact List not exist", "path": "https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/list/1" }
- If invalid data passed
422 Unprocessable Entity
{ "errors": [ { "field": "id", "message": "\"id\" must be a number" } ] }
Update a list
https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/list/:id
Request data
Path variables
Field | Required | Description | Type | Default | Example |
---|---|---|---|---|---|
id | true | The list id you want to delete | number | - | 1 |
Body
Field | Required | Description | Type | Default | Example |
---|---|---|---|---|---|
name | false | The name you want to update the list with | string | - | 'new name' |
Example
Call
fetch('https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/list/123', { method: 'PATCH', headers: { 'Api-key': '<TOKEN>', 'Content-Type': 'application/json' }, body: { name: 'cool name' } });
Returns
- An object with a success key
200 OK
{ "success": true }
- If the list does not exist
404 Not Found
{ "message": "Contact List not exist", "path": "https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/list/1" }
- If invalid data passed
422 Unprocessable Entity
{ "errors": [ { "field": "id", "message": "\"id\" must be a number" } ] }
Fields
Create a field
https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/field
Request data
Body
Field | Required | Description | Type | Default | Example |
---|---|---|---|---|---|
mergeTag | true | The name of the mergeTag | string | - | "mergeTag" |
label | true | The name of the label | string | - | "My Label" |
type | true | The type of the field | string, oneof: [ 'DATETIME', 'STRING', 'INTEGER', 'HIDDEN' ] | - | "DATETIME" |
defaultValue | false | Default value of the field | string | - | "Dear Customer" |
isShownOnModificationForm | false | Whether the field will show up on the modification form | boolean | - | false |
Example
Call
fetch('https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/field', { method: 'POST', headers: { 'Api-key': '<TOKEN>', 'Content-Type': 'application/json' }, body: JSON.stringify({ mergeTag: "mergeTag", label: "my label", type: "DEFAULT", defaultValue: "Dear Customer", }) });
Returns
- An object including the created field id, label and mergeTag
200 OK
"createdField": { "id": 1, "label": "My Label", "mergeTag": "mergeTag" }
- If invalid data passed
422 Unprocessable Entity
{ "errors": [ { "label": "\"label\" is required" } ] }
- If type: 'DEFAULT' data passed
422 Unprocessable Entity
{ "errors": [ { "field": "type", "message": "\"type\" must be one of [DATETIME, STRING, INTEGER, HIDDEN]" } ] }
Get a field
https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/field/:id
Request data
Path variables
Field | Required | Description | Type | Default | Example |
---|---|---|---|---|---|
id | true | The field id you want to get | number | - | 1 |
Example
Call
fetch('https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/field/123', { method: 'GET', headers: { 'Api-key': '<TOKEN>', 'Content-Type': 'application/json' }, });
Returns
- The field data
200 OK
{ "id": 123, "mergeTag": "mergeTag", "label": "label", "isShownOnModificationForm": true, "type": "STRING", "defaultValue": "defaultValue", "createdAt": "2021-12-03T16:49:24.328Z", "updatedAt": "2021-12-03T16:49:24.328Z" }
- If invalid data passed
422 Unprocessable Entity
{ "errors": [ { "field": "id", "message": "\"id\" must be a number" } ] }
- If the Field not exist
404 Not Found
{ "message": "Field not exist", "path": "https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/field/43" }
Get a list of fields
https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/field
Request data
Query params
Field | Required | Description | Type | Default | Example |
---|---|---|---|---|---|
hidden | false | Filter to get or exclude the HIDDEN type fields | boolean | - | true |
page | false | The n-th page you want to get | number | - | 1 |
pageSize | false | The size of the selection | number | - | 10 |
Example
Call
fetch('https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/field?' + new URLSearchParams({ page:1, pageSize:10 }), { method: 'GET', headers: { 'Api-key': '<TOKEN>', 'Content-Type': 'application/json' } });
Returns
- An array includes field objects
200 OK
{ "totalItems": 2, "totalPages": 1, "currentPage": 1, "items": [ { "id": 1, "mergeTag": "mergeTag", "label": "label", "isShownOnModificationForm": true, "type": "STRING", "defaultValue": "defaultValue", "createdAt": "2021-12-03T16:49:24.328Z", "updatedAt": "2021-12-03T16:49:24.328Z" }, { "id": 2, "mergeTag": "mergeTag2", "label": "label2", "isShownOnModificationForm": true, "type": "STRING", "defaultValue": "defaultValue2", "createdAt": "2021-12-03T16:49:24.328Z", "updatedAt": "2021-12-03T16:49:24.328Z" } ] }
- If the list is empty
200 OK
{ "totalItems": 0, "totalPages": 0, "currentPage": 0, "items": [] }
- If invalid data passed
422 Unprocessable Entity
{ "errors": [ { "field": "page", "message": "\"page\" must be a number" } ] }
Delete a field
https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/field/:id
Request data
Path variables
Field | Required | Description | Type | Default | Example |
---|---|---|---|---|---|
id | true | The Field id you want to delete | number | - | 1 |
Example
Call
fetch('https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/field/123', { method: 'DELETE', headers: { 'Api-key': '<TOKEN>', 'Content-Type': 'application/json' } });
Returns
- An object with a success key
200 OK
{ "success": true }
- If delete DEFAULT type Field
422 Unprocessable Entity
{ "message": "DEFAULT type Field cannot be deleted", "path": "https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/field/1" }
- If invalid data passed
422 Unprocessable Entity
{ "errors": [ { "id": "\"id\" must be a number" } ] }
Update a field
https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/field/:id
Request data
Path variables
Field | Required | Description | Type | Default | Example |
---|---|---|---|---|---|
id | true | The Field id you want to update | number | - | 1 |
Body for following types: DATETIME, STRING, INTEGER, HIDDEN
Field | Required | Description | Type | Default | Example |
---|---|---|---|---|---|
mergeTag | false | The name of the mergeTag | string | - | "mergeTag" |
label | false | The name of the label | string | - | "My Label" |
defaultValue | false | Default value of the field | string | - | "Dear Customer" |
isShownOnModificationForm | false | Whether the field will show up on the modification form | boolean | - | false |
Body for following type: DEFAULT
Field | Required | Description | Type | Default | Example |
---|---|---|---|---|---|
defaultValue | false | Default value of the field | string | - | "Dear Customer" |
isShownOnModificationForm | false | Whether the field will show up on the modification form | boolean | - | false |
Example
Call
fetch('https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/field/123', { method: 'POST', headers: { 'Api-key': '<TOKEN>', 'Content-Type': 'application/json' }, body: JSON.stringify({ mergeTag: "mergeTag2", label: "my label2", type: "STRING", defaultValue: "Hey Customer!", }) });
Returns
- An object with a success key
200 OK
{ "success": true }
- If a field with the same merge tag for account already exist
409 Conflict
{ "message": "Field already exist", "path": "/api/contact-manager/contact/field/1" }
- If invalid data passed
422 Unprocessable Entity
{ "errors": [ { "id": "\"id\" must be a number" }, { "label": "\"name\" must be a string" } ] }
Tags
Create a tag
https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/tag
Request data
Body
Field | Required | Description | Type | Default | Example |
---|---|---|---|---|---|
name | true | The name of the tag | string | - | "My Tag" |
Example
Call
fetch('https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/tag', { method: 'POST', headers: { 'Api-key': '<TOKEN>', 'Content-Type': 'application/json' }, body: JSON.stringify({ name:"My Tag" }) });
Returns
- An object includes the created tag id.
200 OK
{ "id": 123 }
- If invalid data passed
422 Unprocessable Entity
{ "errors": [ { "name": "\"name\" is required" } ] }
Get a tag
https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/tag/:id
Request data
Path variables
Field | Required | Description | Type | Default | Example |
---|---|---|---|---|---|
id | true | The tag id you want to get | number | - | 1 |
Example
Call
fetch('https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/tag/123', { method: 'GET', headers: { 'Api-key': '<TOKEN>', 'Content-Type': 'application/json' }, });
Returns
- An object includes the tag data.
200 OK
{ "id": 123, "name": "Tag", "createdAt": "2021-12-03T16:49:24.328Z", "updatedAt": "2021-12-03T16:49:24.328Z" }
- If the tag not exist
404 Not Found
{ "errors": [ { "field": "id", "message": "\"id\" must be a number" } ] }
- If invalid data passed
422 Unprocessable Entity
{ "errors": [ { "field": "id", "message": "\"id\" must be a number" } ] }
Get a list of tags
https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/tag
Request data
Query params
Field | Required | Description | Type | Default | Example |
---|---|---|---|---|---|
page | false | The n-th page you want to get | number | - | 1 |
pageSize | false | The size of the selection | number | - | 10 |
Example
Call
fetch('https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/tag?' + new URLSearchParams({ page:1, pageSize:10 }), { method: 'GET', headers: { 'Api-key': '<TOKEN>', 'Content-Type': 'application/json' } });
Returns
- An array includes tag objects
200 OK
{ "totalItems": 2, "totalPages": 1, "currentPage": 1, "items": [ { "id": 1, "name": "Tag1", "createdAt": "2021-10-14T13:40:57.000Z", "updatedAt": "2021-10-14T13:40:57.000Z" }, { "id": 2, "name": "Tag2", "createdAt": "2021-10-14T13:49:29.000Z", "updatedAt": "2021-10-14T13:49:29.000Z" } ] }
- If the list is empty
200 OK
{ "totalItems": 0, "totalPages": 0, "currentPage": 0, "items": [] }
- If invalid data passed
422 Unprocessable Entity
{ "errors": [ { "field": "page", "message": "\"page\" must be a number" } ] }
Delete a tag
https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/tag/:id
Request data
Path variables
Field | Required | Description | Type | Default | Example |
---|---|---|---|---|---|
id | true | The Tag id you want to delete | number | - | 1 |
Example
Call
fetch('https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/tag/123', { method: 'DELETE', headers: { 'Api-key': '<TOKEN>', 'Content-Type': 'application/json' } });
Returns
- An object with a success key
200 OK
{ "success": true }
- If invalid data passed
422 Unprocessable Entity
{ "errors": [ { "id": "\"id\" must be a number" } ] }
Update a tag
https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/tag/:id
Request data
Path variables
Field | Required | Description | Type | Default | Example |
---|---|---|---|---|---|
id | true | The Tag id you want to update | number | - | 1 |
Body
Field | Required | Description | Type | Default | Example |
---|---|---|---|---|---|
name | true | The name of the tag | string | - | "My Tag" |
Example
Call
fetch('https://api.automizy-gateway-1.com/contact-manager-service-http/public/api/contact-manager/tag/123', { method: 'POST', headers: { 'Api-key': '<TOKEN>', 'Content-Type': 'application/json' }, body: JSON.stringify({ name:"My Tag" }) });
Returns
- An object with a success key
200 OK
{ "success": true }
- If invalid data passed
422 Unprocessable Entity
{ "errors": [ { "id": "\"id\" must be a number" }, { "name": "\"name\" must be a string" } ] }