REST API: Carriers
Using the Carriers REST API, you can create, search, and update carriers within your AMS+ account.
Carrier Resources
Create
RESOURCE URI
https://app.agencybloc.com/api/v1/carriers/create
REQUIRED POST PARAMETERS
You must POST the following parameters via the body of the request. Parameters found in the querystring of the request will be ignored:
Parameter | Description |
---|---|
carrierName | The name of the new carrier that is being created in your AMS+ account. |
carrierAbbrev | The abbreviation of the new carrier that is being created in your AMS+ account. |
ADDITIONAL POST PARAMETERS
You may also POST any of the following parameters:
Parameter | Description |
---|---|
carrierAbbrev |
You may also POST phone numbers for the new carrier using these parameters:
Parameter | Description |
---|---|
homePhone | The home phone number of the new carrier that is being created in your AMS+ account. This value will be displayed in the 'Contact Information' section of the new carrier being created. |
homePhoneExt | The home phone number extension of the new carrier that is being created in your AMS+ account. This value will be displayed in the 'Contact Information' section of the new carrier being created. |
businessPhone | The business phone number of the new carrier that is being created in your AMS+ account. This value will be displayed in the 'Contact Information' section of the new carrier being created. |
businessPhoneExt | The business phone number extension of the carrier that is being updated in your AMS+ account. This value will be displayed in the 'Contact Information' section of the carrier being updated. |
cellPhone | The cell phone number of the new carrier that is being created in your AMS+ account. This value will be displayed in the 'Contact Information' section of the new carrier being created. |
cellPhoneExt | The cell phone number extension of the new carrier that is being created in your AMS+ account. This value will be displayed in the 'Contact Information' section of the new carrier being created. |
When sending phone numbers via POST, please ensure that all phone numbers are formatted as (319) 555-0000
.
You may also POST address information for the new carrier using these parameters:
Note: You can also create, update and delete addresses using the Addresses API.
Parameter | Description |
---|---|
addrType* | The address type of the new carrier that is being created in your AMS+ account. This value will be displayed in the 'Contact Information' section of the new carrier being created. |
street1 | The first line of the address of the new carrier that is being created in your AMS+ account. This value will be displayed in the 'Contact Information' section of the new carrier being created. |
street2 | The second line of the address of the new carrier that is being created in your AMS+ account. This value will be displayed in the 'Contact Information' section of the new carrier being created. |
city | The city of the new carrier that is being created in your AMS+ account. This value will be displayed in the 'Contact Information' section of the new carrier being created. |
stateAbbrev | The state abbreviation of the new carrier that is being created in your AMS+ account. This value will be displayed in the 'Contact Information' section of the new carrier being created. |
zip | The zip code of the new carrier that is being created in your AMS+ account. This value will be displayed in the 'Contact Information' section of the new carrier being created. |
Custom Fields
The REST API allows access to the custom fields inside your account when creating a new carrier. In order to pass custom fields via the REST API, you will need to preface the names of the custom fields inside your account with 'custom_'. To obtain the name values for the custom fields, you will need to access the custom fields page below.
https://app.agencybloc.com/settings/custom-fields/Carrier/list
By selecting the entity type from the dropdown, you will see the list of that entity's custom fields. All names must match exactly what is listed on the page, along with the preface of 'custom_'.
Note: When passing custom field data for Checkbox List custom fields, multiple values need to be separated by ||. For example, “option 1||option 2”.
RESPONSE
A return response will be generated after you have consumed the API. Upon successfully creating a new carrier inside your AMS+ account, you will get a return status of 200 along with the carrierID as seen below.
{ "Agencybloc Response": { "Status":"200", "carrierID":"123456", "Action":"create" } }
Search
RESOURCE URI
https://app.agencybloc.com/api/v1/carriers/search
REQUIRED POST PARAMETERS
There are no required POST parameters for searching. However, if you do not include any parameters the results are limited to 50 carriers.
ADDITIONAL POST PARAMETERS
You may also POST any of the following parameters:
Parameter | Description |
---|---|
carrierName | The name of the carrier being updated in your AMS+ account. |
limit | Pass in the limit parameter for a custom number of results. If a limit isn't present, defaults to show 50 results. If the limit is 0, returns all results. |
homePhone | The home phone number of the carrier being searched. |
cellPhone | The cell phone number of the carrier being searched. |
businessPhone |
The business phone number of the carrier being searched. |
anyPhone | Pass this parameter in to search all phone numbers (home, cell, business). |
RESPONSE
[
{
"carrierID": 123456,
"carrierName": "Carrier Example",
"carrierAbbreviation": "CE",
"homePhone": "(555) 555-5555",
"businessPhone": "(444) 444-4444",
"cellPhone": "(333) 333-3333" }
]
Update
RESOURCE URI
https://app.agencybloc.com/api/v1/carriers/update
REQUIRED POST PARAMETERS
You must POST the following parameters via the body of the request. Parameters found in the querystring of the request will be ignored:
Parameter | Description |
---|---|
carrierID | The carrier ID of the carrier that is being updated in your AMS+ account. |
ADDITIONAL POST PARAMETERS
You may also POST any of the following parameters:
Parameter | Description |
---|---|
carrierName | The name of the carrier that is being updated in your AMS+ account. |
carrierAbbrev | The abbreviation of the new carrier that is being updated in your AMS+ account. |
You may also POST phone numbers for the new carrier using these parameters:
Parameter | Description |
---|---|
homePhone | The home phone number of the carrier that is being updated in your AMS+ account. This value will be displayed in the 'Contact Information' section of the carrier being updated. |
homePhoneExt | The home phone number extension of the carrier that is being updated in your AMS+ account. This value will be displayed in the 'Contact Information' section of the carrier being updated. |
businessPhone | The business phone number of the carrier that is being updated in your AMS+ account. This value will be displayed in the 'Contact Information' section of the carrier being updated. |
businessPhoneExt | The business phone number extension of the carrier that is being updated in your AMS+ account. This value will be displayed in the 'Contact Information' section of the carrier being updated. |
cellPhone | The cell phone number of the carrier that is being updated in your AMS+ account. This value will be displayed in the 'Contact Information' section of the carrier being updated. |
cellPhoneExt | The cell phone number extension of the carrier that is being created in your AMS+ account. This value will be displayed in the 'Contact Information' section of the carrier being updated. |
When sending phone numbers via POST, please ensure that all phone numbers are formatted as (319) 555-0000
.
Note: You may also update addresses for the carrier using the Addresses API.
Custom Fields
The REST API allows access to the custom fields inside your account when updating a carrier. In order to pass custom fields via the REST API, you will need to preface the names of the custom fields inside your account with 'custom_'. To obtain the name values for the custom fields, you will need to access the custom fields page below.
https://app.agencybloc.com/settings/custom-fields/Carrier/list
By selecting the entity type from the dropdown, you will see the list of that entity's custom fields. All names must match exactly what is listed on the page, along with the preface of 'custom_'.
Note: When passing custom field data for Checkbox List custom fields, multiple values need to be separated by ||. For example, “option 1||option 2”.
RESPONSE
A return response will be generated after you have consumed the API. Upon successfully updating a carrier inside your AMS+ account, you will get a return status of 200 along with the carrierID as seen below.
{ "Agencybloc Response": { "Status":"200", "carrierID":"123456", "Action":"update" } }
Exception Responses
The exception responses will include status, title, and message and be in JSON format.
{ "Agencybloc Response": { "Exception": { "Status":"Status Code", "Title":"Title of Error", "Message":"Error Message" } }