REST API: Policies
Using the Policies REST API, you can create, search, update and view the full detail of policies within your AMS+ account.
When creating or updating field values that use a checkbox list or dropdown with user-defined values in Data & Custom Fields via API request, please note that any new values that did not previously exist will be automatically added.
Policy Resources
Create
RESOURCE URI
https://app.agencybloc.com/api/v1/policies/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 |
---|---|
entityID | The ID of the entity (Group or Individual) that the new policy will be tied to in your AMS+ account. Use the respective groupID or individualID for this value. |
entityTypeID | The type of entity of the new policy that is being created in your AMS+ account. Must contain "Group" or "Individual". |
policyCoverageType* | The coverage type of the new policy being created in your AMS+ account. This value will populate the 'Policy Coverage Type' dropdown within the 'Policy Detail' section of the new policy being created. |
policyStatus* | The status of the new policy being created in your AMS+ account. This value will populate the 'Policy Status' dropdown within the 'Policy Detail' section of the new policy being created. |
carrier | The full Carrier Name of the new policy that is being created in your AMS+ account. |
ADDITIONAL POST PARAMETERS
You may also POST any of the following parameters:
Parameter | Description |
---|---|
policyNumber | The policy number of the new policy that is being created in your AMS+ account. |
appSubmitDate | The app submit date of the new policy that is being created in your AMS+ account. |
effectiveDate | The effective date of the new policy that is being created in your AMS+ account. |
renewalDate | The renewal date of the new policy being created in your AMS+ account. |
renewalIncrease | The renewal increase of the new policy being created in your AMS+ account. |
termDate | The term date of the new policy being created in your AMS+ account. |
premium | The premium of the new policy being created in your AMS+ account. |
payFrequency | The pay frequency of the new policy being created in your AMS+ account. |
lives | The lives of the new policy being created in your AMS+ account. |
projectCode* | The projectCode of the new policy being created in your AMS+ account. This value will populate the 'Project Code' dropdown within the 'Policy Detail' section of the new policy being created. |
waitingPeriod | The waiting period of the new policy being created in your AMS+ account. |
classifications | The classifications of the new policy being created in your AMS+ account. |
notes | The notes of the new policy being created in your AMS+ account. |
carrierProduct |
The Carrier Product for the policy. Sending this value will result in the creation of a Coverage for the policy. If the Product specified does not exist for the Carrier, it will be created. The Carrier must be specified when this value is provided. |
issueDate |
The issue date of the new policy being created in your AMS+ account. |
When sending dates via POST, please ensure that the dates are formatted as 01/01/2013
.
You may also POST agent information for the new policy using these parameters:
Parameter | Description |
---|---|
servicingAgentID | The ID of the servicing agent within AMS+ that is assigned to the new policy that is being created in your AMS+ account. This value will be used to display the 'Servicing Agent' in the 'Policy Detail' section of the new policy being created. |
servicingAgentLastName | The last name of the servicing agent within AMS+ that is assigned to the new policy that is being created in your AMS+ account. This value will be used to display the 'Servicing Agent' in the 'Policy Detail' section of the new policy being created. |
servicingAgentFirstName | The first name of the servicing agent within AMS+ that is assigned to the new policy that is being created in your AMS+ account. This value will be used to display the 'Servicing Agent' in the 'Policy Detail' section of the new policy being created. |
signedByAgentID | The ID of the signed by agent within AMS+ that is assigned to the new policy that is being created in your AMS+ account. This value will be used to display the 'Signed By' in the 'Policy Detail' section of the new policy being created. |
signedByAgentLastName | The last name of the signed by agent within AMS+ that is assigned to the new policy that is being created in your AMS+ account. This value will be used to display the 'Signed By' in the 'Policy Detail' section of the new policy being created. |
signedByAgentFirstName | The first name of the signed by agent within AMS+ that is assigned to the new policy that is being created in your AMS+ account. This value will be used to display the 'Signed By' in the 'Policy Detail' section of the new policy being created. |
To get the corresponding 'Agent ID' from AMS+, you will need to get the unique identifier used within AMS+. To get this value you will need to navigate to the 'Agent Detail' screen within AMS+. Once you have reached that page you can get the value from the URL:
https://app.agencybloc.com/agents/######/detail
The 'Agent ID' used by AMS+ is represented by the ######
in the link above. By sending this value via POST, the API will assign the corresponding agent to the new policy being created.
When sending the agent's first and last name via POST, the agent's first and last name will need to match exactly as it appears within AMS+. If the names don't match exactly what is on file in AMS+, the agent will not be assigned.
You may also POST user information for the new policy using these parameters:
Parameter | Description |
---|---|
accountManager | The user ID of the account manager within AMS+ that is assigned to the new policy that is being created in your AMS+ account. This value will be used to display the 'Account Manager' in the 'Policy Detail' section of the new policy being created. |
accountManager |
A user matching the provided first and last name within your account in AMS+ is assigned to the new policy that is being created. his value will be used to display the 'Account Manager' in the 'Policy Detail' section of the new policy being created. Values can be provided as either “FirstName LastName” or “LastName, FirstName.” |
To get the corresponding 'User ID' from AMS+, you will need to get the unique identifier used within AMS+. To get this value you will need to navigate to the 'User Edit' screen under 'Settings->User Administration' within AMS+. Once you have reached that page you can get the value from the URL:
https://app.agencybloc.com/settings/user-administration/edit/#####
The 'User ID' used by AMS+ is represented by the ######
in the link above. By sending this value via POST, the API will assign the corresponding 'Account Manager' to the new policy being created.
When sending the user's first and last name via POST, the user's first and last name will need to match exactly as it appears within AMS+. If the names don't match exactly what is on file in AMS+, the 'Account Manager' will not be assigned.
Custom Fields
The REST API allows access to the custom fields inside your account when creating a new Policy. 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/Policy/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 policy inside your AMS+ account, you will get a return status of 200 along with the policyID as seen below.
{ "Agencybloc Response": { "Status":"200", "policyID":"123456", "Action":"create" } }
Search
RESOURCE URI
https://app.agencybloc.com/api/v1/policies/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 policies.
ADDITIONAL POST PARAMETERS
You may POST any of the following parameters to search for a policy:
Parameter | Description |
---|---|
policyNumber | The policy number of the policy being searched. |
policyCoverageType* | The coverage type of the policy being searched. |
carrier | The carrier of the policy being searched. |
appSubmitDateAfter | The Application Submit Date used to search for a policy. This date can be used to get a policy with an Application Submit Date on or after the value sent via the POST. |
appSubmitDateBefore | The Application Submit Date used to search for a policy. This date can be used to get a policy with an Application Submit Date on or before the value sent via the POST. |
updatedDTM | The date of last update within AMS+ for the policy being searched. Returns policies modified on or after the date value sent via the POST. |
entityID | The ID of the entity of the policy that is being searched. |
entityTypeID | The type of entity of the policy that is being searched. |
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. |
When sending dates via POST, please ensure that the dates are formatted as 01/01/2013
.
You may also POST agent information to search a policy using these parameters:
Parameter | Description |
---|---|
servicingAgentID | The ID of the servicing agent within AMS+ that is assigned to the policy that is being searched. |
servicingAgentLastName | The last name of the servicing agent within AMS+ that is assigned to the policy that is being searched. |
servicingAgentFirstName | The first name of the servicing agent within AMS+ that is assigned to the policy that is being searched. |
To get the corresponding 'Agent ID' from AMS+, you will need to get the unique identifier used within AMS+. To get this value you will need to navigate to the 'Agent Detail' screen within AMS+. Once you have reached that page you can get the value from the URL:
https://app.agencybloc.com/agents/######/detail
The 'Agent ID' used by AMS+ is represented by the ######
in the link above.
RESPONSE
The response will be a list of policies matching your criteria in JSON format.
The detail_url is the url that can be used to retrieve the full detail of the policy.
[ { "policyID": 12345, "entityID": 98745, "entityTypeID": "Group", "policyNumber": "1111", "carrier": "Example", "policyStatus": "Example", "policyCoverageType": "Example", "effectiveDate": "1111-11-11T00:00:00", "renewalDate": "1111-11-11T00:00:00", "detailURL":"https://app.agencybloc.com/api/v1/policies/detail" }, { "policyID": 54321, "entityID": 12345, "entityTypeID": "Individual",
"policyNumber": "1111", "policyNumber": "1111", "carrier": "Example", "policyStatus": "Example", "policyCoverageType": "Example", "effectiveDate": "1111-11-11T00:00:00", "renewalDate": "1111-11-11T00:00:00", "detailURL":"https://app.agencybloc.com/api/v1/policies/detail" } ]
Detail
RESOURCE URI
https://app.agencybloc.com/api/v1/policies/detail
REQUIRED POST PARAMETER
Parameter | Description |
---|---|
policyID | The policyID returned from the search response |
RESPONSE
The response will be the full detail of the policy selected and include all addresses associated with policy.
{ "PolicyID": 12345, "HolderID": 54321, "HolderType": "Group", "HolderName": "Example", "AgentID": 123, "AgentName": "Example", "AgentNumID": 1,
"AdditionalAgent1ID": 123,
"AdditionalAgent1Name": "Example",
"AdditionalAgent2ID": 123,
"AdditionalAgent2Name": "Example",
"AdditionalAgent3ID": 123,
"AdditionalAgent3Name": "Example",
"AdditionalAgent4ID": 123,
"AdditionalAgent4Name": "Example",
"AdditionalAgent5ID": 123,
"AdditionalAgent5Name": "Example",
"CarrierID": 1234, "CarrierName": "Example", "StatusLookupID": 3456, "StatusDescript": "Example", "SignedByAgentID": 6789, "SignedByAgentName": "Example", "AcctMgrUserID": 123, "AcctMgrName": "Example", "PolicyNumber": "Example",
"IssueDate": "2019-02-02T00:00:00", "EffectiveDate": "1111-01-01T00:00:00", "RenewalDate": "1111-01-01T00:00:00", "RenewalIncrease": 0, "TermDate": "1111-01-01T00:00:00", "Lives": 123, "Notes": "Example", "CommissionFreq": 0, "ClientID": 0, "Active": 1, "Deleted": 0, "CoverageTypeLookupID": 123, "CoverageTypeDescript": "Example", "Premium": 1000, "ProjectCodeLookupID": 4567, "ProjectCodeDescript": "Example", "AppSubmitDate": "1111-01-01T00:00:00", "PayFreq": 1, "coverages": [ { "PolicyCoverageID": 12345, "CarrierProduct": "Health" } ], "customFields": [ { "Name": "Custom Field 1", "Value": [ "Example" ] }, { "Name": "Custom Field 2 (Multi-Select)", "Value": [ "option 1||option 2" ] } ] }
Update
RESOURCE URI
https://app.agencybloc.com/api/v1/policies/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 |
---|---|
policyID | The ID of the policy that is being updated in your AMS+ account. |
ADDITIONAL POST PARAMETERS
You may also POST any of the following parameters:
Parameter | Description |
---|---|
policyNumber | The policy number of the policy that is being updated in your AMS+ account. |
policyCoverageType* | The coverage type of the policy being updated in your AMS+ account. This value will populate the 'Policy Coverage Type' dropdown within the 'Policy Detail' section of the policy being updated. |
policyStatus* | The status of the policy being updated in your AMS+ account. This value will populate the 'Policy Status' dropdown within the 'Policy Detail' section of the policy being updated. |
carrier | The carrier of the policy that is being updated in your AMS+ account. |
appSubmitDate | The app submit date of the policy that is being updated in your AMS+ account. |
effectiveDate | The effective date of the policy that is being updated in your AMS+ account. |
renewalDate | The renewal date of the policy being updated in your AMS+ account. |
renewalIncrease | The renewal increase of the policy being updated in your AMS+ account. |
termDate | The term date of the policy being updated in your AMS+ account. |
premium | The premium of the policy being updated in your AMS+ account. |
payFrequency | The pay frequency of the policy being updated in your AMS+ account. |
lives | The lives of the policy being updated in your AMS+ account. |
projectCode* | The projectCode of the policy being updated in your AMS+ account. This value will populate the 'Project Code' dropdown within the 'Policy Detail' section of the policy being updated. |
waitingPeriod | The waiting period of the policy being updated in your AMS+ account. |
classifications | The classifications of the policy being updated in your AMS+ account. |
notes | The notes of the policy being updated in your AMS+ account. |
carrierProduct | The Carrier Product for the policy. If the Product specified does not exist for the Carrier, it will be created. The Carrier must be specified when this value is provided. If a single Coverage already exists for the Policy, it is updated; in all other cases, a new Coverage is created. |
issueDate |
The issue date of the new policy being created in your AMS+ account. |
When sending dates via POST, please ensure that the dates are formatted as 01/01/2013
.
You may also POST agent information for the new policy using these parameters:
Parameter | Description |
---|---|
servicingAgentID | The ID of the servicing agent within AMS+ that is assigned to the new policy that is being updated in your AMS+ account. This value will be used to display the 'Servicing Agent' in the 'Policy Detail' section of the new policy being updated. |
servicingAgentLastName | The last name of the servicing agent within AMS+ that is assigned to the new policy that is being updated in your AMS+ account. This value will be used to display the 'Servicing Agent' in the 'Policy Detail' section of the new policy being updated. |
servicingAgentFirstName | The first name of the servicing agent within AMS+ that is assigned to the new policy that is being updated in your AMS+ account. This value will be used to display the 'Servicing Agent' in the 'Policy Detail' section of the new policy being updated. |
signedByAgentID | The ID of the signed by agent within AMS+ that is assigned to the new policy that is being updated in your AMS+ account. This value will be used to display the 'Signed By' in the 'Policy Detail' section of the new policy being updated. |
signedByAgentLastName | The last name of the signed by agent within AMS+ that is assigned to the new policy that is being updated in your AMS+ account. This value will be used to display the 'Signed By' in the 'Policy Detail' section of the new policy being updated. |
signedByAgentFirstName | The first name of the signed by agent within AMS+ that is assigned to the new policy that is being updated in your AMS+ account. This value will be used to display the 'Signed By' in the 'Policy Detail' section of the new policy being updated. |
To get the corresponding 'Agent ID' from AMS+, you will need to get the unique identifier used within AMS+. This value will need to be retrieved using either an agent 'search' or agent 'detail' call to the AMS+ API. You may alse get this value by navigating to the 'Agent Detail' screen within AMS+. Once you have reached that page you can get the value from the URL:
https://app.agencybloc.com/agents/######/detail
The 'Agent ID' used by AMS+ is represented by the ######
in the link above. By sending this value via POST, the API will assign the corresponding agent to the new policy being created.
When sending the agent's first and last name via POST, the agent's first and last name will need to match exactly as it appears within AMS+. If the names don't match exactly what is on file in AMS+, the agent will not be assigned.
Custom Fields
The REST API allows access to the custom fields inside your account when updating a policy. 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/Policy/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 policy inside your AMS+ account, you will get a return status of 200 along with the groupID as seen below.
{ "Agencybloc Response": { "Status":"200", "policyID":"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" } } }