Automizy REST API Docs

Developers Page

Introduction to Automizy REST API

What is Automizy REST API?

Automizy REST API is a RESTful application programming interface made for Automizy, so it meets the constraints and requirements of REST.

Communicate through the API

Anything you can do by using the software's user interface can be done also by calling the right methods of the API, since the also the UI uses this API for communication.

Easy to integrate

By using Automizy REST API there are no limits of integrating Automizy into other systems.

Headers

Authentication headers

Field Type Description
Api-key String Api token
Content-Type String Request content type
Accept String Response content type
Header example
{
  "Content-Type": "application/json",
  "Accept": "application/json"
}
                

Authentication

Authentication is used to access the server.

Getting access token

In Automizy you can create multiple access tokens use can use to interact with our system.
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

Contacts are the people, email addresses you order into send your campaigns.

Get a contact

GET
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
javascript
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

Response example
{
    "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

Response example
{
    "error": "Contact not exist",
    "id": 123
}
        
  • If invalid data passed

422 Unprocessable Entity

Response example
{
    "errors": [
      {
        "id": "\"id\" must be a number"
      }
    ]
}
    

IMPORT STEP 1 - Analyze import

The system reads the file and analyzes the headers, gives the import and ID which can be used for a certain time.
POST
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
javascript
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

Response example
{
    "importId": 123,
    "headers": ["header1", "header2", "header3"]
}
  • If no file passed

500 Internal server error

Response example
Internal server error

IMPORT STEP 2 - Process an import

After the analyzation is ready, and you've set the headers, you can start importing your contacts. Notification Email will be sent upon import completion, if not present it will be retrieved from token.
POST
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
javascript
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

Response example
{
    "success": true
}
  • If invalid data passed

422 Unprocessable Entity

Response example
{
    "errors": [
      {
        "notificationEmailAddress": "\"notificationEmailAddress\" is required"
      }
    ]
}

Delete a contact

DELETE
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
javascript
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

Response example
{
    "success": true
}
  • If invalid data passed

422 Unprocessable Entity

Response example
{
    "errors": [
      {
        "field": "id",
        "message": "\"id\" must be a number"
      }
    ]
}
  • If the contact does not exist

404 Not Found

Response example
{
    "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

Updates the contacts status
PATCH
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
javascript
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

Response example
{
    "success": true
}
  • If invalid data passed

422 Unprocessable Entity

Response example
{
    "errors": [
      {
        "field": "id",
        "message": "\"id\" must be a number"
      }
    ]
}
  • If the contact does not exist

404 Not Found

Response example
{
    "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

Updates the contact's email address, if not taken
PATCH
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
javascript
            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

Response example
            {
                "success": true
            }
            
  • If invalid data passed

422 Unprocessable Entity

Response example
            {
                "errors": [
                  {
                    "field": "id",
                    "message": "\"id\" must be a number"
                  }
                ]
            }
            
  • If a contact with the same email address for account already exist

409 Conflict

Response example
            {
                "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

Response example
            {
                "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

Sets a contact's tags, creates them if they dont exist
PATCH
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
javascript
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

Response example
{
    "success": true
}
          
  • If invalid data passed

422 Unprocessable Entity

Response example
{
    "errors": [
      {
        "id": "\"id\" must be a number"
      },
      {
        "tagNameList": "\"tagNameList\" must be an array"
      }
    ]
}
  • If contact not exist

404 Not Found

Response example
{
    "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

Updates the contact's fields value
PATCH
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
javascript
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

Response example
{
    "success": true
}
  • If the Contact not exist

404 Not Found

Response example
{
    "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

Response example
{
    "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

Response example
{
    "errors": [
      {
        "id": "\"id\" must be a number"
      },
      {
        "name": "\"name\" must be a string"
      }
    ]
}

Lists

Lists API organizes subscribers into different groups.
Currently in Automizy you can't create a contact that doesn't belong to at least one list.

Create a list

Creates a new list and returns an object includes the created list id
POST
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
javascript
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

Response example
{
    "id": 123,
    "name": "List"
}
            
  • If invalid data passed

422 Unprocessable Entity

Response example
{
    "errors": [
      {
        "name": "\"name\" is required"
      }
    ]
}
            
  • If no data passed

422 Unprocessable Entity

Response example
{
    "errors": [
      {
        "message": "'name' parameter required."
      }
    ]
}
            

Create a contact on a list

Creates the contact, adds it to the list, adds the fields with values. Returns the contacts id. If the contact already exists on a different list, it will instead just put the contact on the new list. Returns the contacts id If the contact has been deleted, it restores the contact on the new list, removing it from any other lists. Returns the contacts id In every case the fields will be updated.
POST
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
javascript
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

Response example
{
    "id": 123
}
  • If not existing list passed

404 Not Found

Response example
{
    "message": "Contact List not exist"
}
  • If not existing field passed

404 Not Found

Response example
{
    "message": "Field not exist"
}
  • If invalid data passed

422 Unprocessable Entity

Response example
{
    "errors": [
      {
        "emailAddress": "\"emailAddress\" is required"
      }
    ]
}

Get a list

GET
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
javascript
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

Response example
{
    "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

Response example
{
    "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

Response example
{
    "errors": [
      {
        "field": "id",
        "message": "\"id\" must be a number"
      }
    ]
}
  • If no data passed

422 Unprocessable Entity

Response example
{
    "errors": [
      {
        "field": "id",
        "message": "\"id\" must be a number"
      }
    ]
}

Get a list of lists

GET
/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
javascript
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

Response example
{
    "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

Response example
{
    "totalItems": 0,
    "totalPages": 0,
    "currentPage": 0,
    "items": []
}
            
  • If invalid data passed

422 Unprocessable Entity

Response example
{
    "errors": [
      {
        "field": "page",
        "message": "\"page\" must be a number"
      }
    ]
}
            

Get all contacts from a list

Returns the filtered contacts data
POST
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
javascript
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

Response example
{
    "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

Response example
{
    "totalItems": 0,
    "totalPages": 0,
    "currentPage": 0,
    "items": []
}
  • If invalid data passed

422 Unprocessable Entity

Response example
{
    "errors": [
      {
        "field": "page",
        "message": "\"page\" must be a number"
      }
    ]
}

Delete a list

Deletes the list and the list exclusive contacts
DELETE
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
javascript
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

Response example
{
    "success": true
}
            
  • If the list does not exist

404 Not Found

Response example
{
    "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

Response example
{
    "errors": [
      {
        "field": "id",
        "message": "\"id\" must be a number"
      }
    ]
}
            

Update a list

PATCH
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
javascript
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

Response example
{
    "success": true
}
  • If the list does not exist

404 Not Found

Response example
{
    "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

Response example
{
    "errors": [
      {
        "field": "id",
        "message": "\"id\" must be a number"
      }
    ]
}

Fields

Custom fields can provide you with more information about your contact, like age, gender, etc.

Create a field

POST
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
javascript
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

Response example
"createdField": {
    "id": 1,
    "label": "My Label",
    "mergeTag": "mergeTag"
}
          
  • If invalid data passed

422 Unprocessable Entity

Response example
{
    "errors": [
      {
        "label": "\"label\" is required"
      }
    ]
}
  • If type: 'DEFAULT' data passed

422 Unprocessable Entity

Response example
{
    "errors": [
      {
        "field": "type",
        "message":  "\"type\" must be one of [DATETIME, STRING, INTEGER, HIDDEN]"
      }
    ]
}

Get a field

GET
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
javascript
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

Response example
{
    "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

Response example
{
    "errors": [
      {
        "field": "id",
        "message": "\"id\" must be a number"
      }
    ]
}
  • If the Field not exist

404 Not Found

Response example
{
    "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

GET
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
javascript
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

Response example
{
    "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

Response example
{
    "totalItems": 0,
    "totalPages": 0,
    "currentPage": 0,
    "items": []
}
  • If invalid data passed

422 Unprocessable Entity

Response example
{
    "errors": [
      {
        "field": "page",
        "message": "\"page\" must be a number"
      }
    ]
}

Delete a field

DELETE
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
javascript
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

Response example
{
    "success": true
}
  • If delete DEFAULT type Field

422 Unprocessable Entity

Response example
{
    "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

Response example
{
    "errors": [
      {
        "id": "\"id\" must be a number"
      }
    ]
}

Update a field

PATCH
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
javascript
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

Response example
{
    "success": true
}
  • If a field with the same merge tag for account already exist

409 Conflict

Response example
{
    "message": "Field already exist",
    "path": "/api/contact-manager/contact/field/1"
}
  • If invalid data passed

422 Unprocessable Entity

Response example
{
    "errors": [
      {
        "id": "\"id\" must be a number"
      },
      {
        "label": "\"name\" must be a string"
      }
    ]
}

Tags

Tags are short metadescriptions that can be added to contacts. It is mostly used to show the life-cycle stage, interest or different statuses of contacts in your marketing and sales funnel. Contacts can be filtered based on tags and can be easily segmented based on this metadata.

Create a tag

Creates the tag. Returns the tag's id. If the tag already exists, it will instead just return the tag's id If the tag has been deleted, it restores the tag, removing it from any contacts. Returns the tag's id
POST
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
javascript
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

Response example
{
    "id": 123
}
  • If invalid data passed

422 Unprocessable Entity

Response example
{
    "errors": [
      {
        "name": "\"name\" is required"
      }
    ]
}

Get a tag

GET
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
javascript
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

Response example
{
    "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

Response example
{
    "errors": [
      {
        "field": "id",
        "message": "\"id\" must be a number"
      }
    ]
}
            
  • If invalid data passed

422 Unprocessable Entity

Response example
{
    "errors": [
      {
        "field": "id",
        "message": "\"id\" must be a number"
      }
    ]
}
            

Get a list of tags

GET
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
javascript
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

Response example
{
    "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

Response example
{
    "totalItems": 0,
    "totalPages": 0,
    "currentPage": 0,
    "items": []
}
            
  • If invalid data passed

422 Unprocessable Entity

Response example
{
    "errors": [
      {
        "field": "page",
        "message": "\"page\" must be a number"
      }
    ]
}
            

Delete a tag

DELETE
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
javascript
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

Response example
{
    "success": true
}
          
  • If invalid data passed

422 Unprocessable Entity

Response example
{
    "errors": [
      {
        "id": "\"id\" must be a number"
      }
    ]
}

Update a tag

PATCH
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
javascript
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

Response example
{
    "success": true
}
          
  • If invalid data passed

422 Unprocessable Entity

Response example
{
    "errors": [
      {
        "id": "\"id\" must be a number"
      },
      {
        "name": "\"name\" must be a string"
      }
    ]
}