Additional Fields

On this page, you will learn how to insert, filter and delete your additional fields.

By using additional fields you may assign any kind of information to the person that is not offered out of the box in standard fields.

Additional field methods:

View also Person and Tag

Resource

https://api.infobip.com/people/1/additionalFields

Resource description

Parameter Type Description
id string unique key of a tag returned in method response
createdAt string time when additional field was created returned in method response
modifiedAt string time when additional field was modified returned in method response
name string additional field name
dataType string additional field type. Supported values are STRING, DECIMAL, INTEGER, BOOLEAN and DATE

Create new additional field 

Create a new additional field by using this method:

POST /people/1/additionalFields HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Accept: application/json

{
    "dataType": "DATE",
    "name": "Contract Expiry Date"
}
POST /people/1/additionalFields HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Accept: application/xml

<?xml version="1.0" encoding="UTF-8" ?>
<dataType>DATE</dataType>
<name>Contract Expiry Date</name>

Response:

{  
   "id":"AA188D2528E9D24F086B33EBABB46298",
   "createdAt":"2018-01-09T12:39:52",
   "modifiedAt":"2018-01-09T12:39:52",
   "name":"Contract Expiry Date",
   "dataType":"DATE"
}
<?xml version="1.0" encoding="UTF-8" ?>
<id>AA188D2528E9D24F086B33EBABB46298</id>
<createdAt>2018-01-09T12:39:52</createdAt>
<modifiedAt>2018-01-09T12:39:52</modifiedAt>
<name>Contract Expiry Date</name>
<dataType>DATE</dataType>

Duplicate additional fields handling

Each additional field name must be unique in the system, names are case-sensitive. If you try to create an additional field with a name that already exists in the system, you will get the following response:

{
    "value": 40002,
    "message": "Duplicate"
}

Get single additional field

Get single additional field using this method:

GET /people/1/additionalFields/BB88A67343C7190D5FE1B3CBD45811C6 HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Accept: application/json
GET /people/1/additionalFields/BB88A67343C7190D5FE1B3CBD45811C6 HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Accept: application/xml

Response:

{
    "id": "AA188D2528E9D24F086B33EBABB46298",
    "createdAt": "2018-01-09T12:39:52",
    "modifiedAt": "2018-01-09T12:39:52",
    "name": "Contract Expiry",
    "dataType": "DATE"
}
<?xml version="1.0" encoding="UTF-8" ?>
<id>AA188D2528E9D24F086B33EBABB46298</id>
<createdAt>2018-01-09T12:39:52</createdAt>
<modifiedAt>2018-01-09T12:39:52</modifiedAt>
<name>Contract Expiry</name>
<dataType>DATE</dataType>

List all additional fields

List all additional field using this method:

GET /people/1/additionalFields/ HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Accept: application/json
GET /people/1/additionalFields/ HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Accept: application/xml

Response:

{
   "limit":20,
   "page":1,
   "orderBy":"modifiedAt:desc",
   "additionalFields":[
      {
         "id":"0405EA4B8C938DC2FD749862566BC3E5",
         "createdAt":"2018-02-01T11:36:39",
         "modifiedAt":"2018-02-01T11:36:39",
         "name":"Company",
         "dataType":"STRING"
      },
      {
         "id":"8B24AB193BD6712A33E3B3356BE398AC",
         "createdAt":"2018-02-01T11:36:39",
         "modifiedAt":"2018-02-01T11:36:39",
         "name":"Contract Expiry",
         "dataType":"DATE"
      }
   ]
}
<?xml version="1.0" encoding="UTF-8" ?>
<limit>20</limit>
<page>1</page>
<orderBy>modifiedAt:desc</orderBy>
<additionalFields>
    <id>0405EA4B8C938DC2FD749862566BC3E5</id>
    <createdAt>2018-02-01T11:36:39</createdAt>
    <modifiedAt>2018-02-01T11:36:39</modifiedAt>
    <name>Company</name>
    <dataType>STRING</dataType>
</additionalFields>
<additionalFields>
    <id>8B24AB193BD6712A33E3B3356BE398AC</id>
    <createdAt>2018-02-01T11:36:39</createdAt>
    <modifiedAt>2018-02-01T11:36:39</modifiedAt>
    <name>Contract Expiry</name>
    <dataType>DATE</dataType>
</additionalFields>

Filter additional fields

Additionally, you can get additional fields by any filter you want. Simply add URL encoded filter parameters to your method.

List of supported logical operators:

Logical Operator Description
#and Joins query clauses with a logical AND returns all records that match the conditions of both clauses
#or Joins query clauses with a logical OR returns all records that match the conditions of either clause

List of supported comparison operators:

Comparison Operator Supported Type Description
#eq string, integer, decimal, date Matches values that are equal to a specified value
#ne string, integer, decimal, date Matches all values that are not equal to a specified value
#contains string Matches the records that contain a specified value
#startsWith string Matches the records that start with a specified value
#endsWith string Matches the records that end with a specified value
#gt integer, decimal, date Matches values that are greater than a specified value
#lt integer, decimal, date Matches values that are less than a specified value
#gte integer, decimal, date Matches values that are greater than or equal to a specified value
#lte integer, decimal, date Matches values that are less than or equal to a specified value

Paging and ordering

Parameter Type Description
limit int If a limit count is given, no more than that many rows will be returned (but possibly less, if the query itself yields fewer rows). The default value is 20.
page int This parameter says to skip that many rows before beginning to return rows. If both page and limit appear, then page rows are skipped before starting to count the limit rows that are returned. The default value is 1.
orderBy string This parameter is used to order your results. If order is not given, the default order modifiedAt:desc will be applied.

Example

Let’s say you want to filter all DATE type additional fields. This would be your JSON:

{  
   "#and":{  
      "dataType":"DATE"
   }
}	
  

When you encode this query, you will have a method like this:

GET /people/1/additionalFields?query=%7B%20%20%0D%0A%20%20%20%22%23and%22%3A%5B%20%20%0D%0A%20%20%20%20%20%20%7B%20%20%0D%0A%20%20%20%20%20%20%20%20%20%22dataType%22%3A%22DATE%22%0D%0A%20%20%20%20%20%20%7D%0D%0A%20%20%20%5D%0D%0A%7D%20%20%20 HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Accept: application/json
GET /people/1/additionalFields?query=%7B%20%20%0D%0A%20%20%20%22%23and%22%3A%5B%20%20%0D%0A%20%20%20%20%20%20%7B%20%20%0D%0A%20%20%20%20%20%20%20%20%20%22dataType%22%3A%22DATE%22%0D%0A%20%20%20%20%20%20%7D%0D%0A%20%20%20%5D%0D%0A%7D%20%20%20 HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Accept: application/xml

Response:

{
    "additionalFields": [
        {
            "id": "AA188D2528E9D24F086B33EBABB46298",
            "createdAt": "2018-01-09T12:39:52",
            "modifiedAt": "2018-01-09T12:39:52",
            "name": "Contract Expiry Date",
            "dataType": "DATE"
        },
        {
            "id": "0DB41CAE31241F79ED4A0B278A233EF8",
            "createdAt": "2018-01-10T18:01:09",
            "modifiedAt": "2018-01-10T18:01:09",
            "name": "Anniversary",
            "dataType": "DATE"
        }
    ]
}
<?xml version="1.0" encoding="UTF-8" ?>
<additionalFields>
    <id>AA188D2528E9D24F086B33EBABB46298</id>
    <createdAt>2018-01-09T12:39:52</createdAt>
    <modifiedAt>2018-01-09T12:39:52</modifiedAt>
    <name>Contract Expiry Date</name>
    <dataType>DATE</dataType>
</additionalFields>
<additionalFields>
    <id>0DB41CAE31241F79ED4A0B278A233EF8</id>
    <createdAt>2018-01-10T18:01:09</createdAt>
    <modifiedAt>2018-01-10T18:01:09</modifiedAt>
    <name>Anniversary</name>
    <dataType>DATE</dataType>
</additionalFields>

Include total count

Add &includes=totalCount as a parameter to get a total count together with a list of additional fields.

Delete additional field

Delete additional field by using this method:

DELETE /people/1/additionalFields/AA188D2528E9D24F086B33EBABB46298 HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Accept: application/json
DELETE /people/1/additionalFields/AA188D2528E9D24F086B33EBABB46298 HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Accept: application/xml

Deleting an additional field which doesn't exist

If you try to delete an additional field which does not exist, you will get the following response:

{
    "errorCode": 40404,
    "errorMessage": "Additional field does not exist"
}