REST API: Agent Licenses
Using the Agent License REST API, you can manage agent licenses 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.
Agent License Resources
Create
RESOURCE URI
https://app.agencybloc.com/api/v1/agents/licenses/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 |
---|---|
agentID | The ID of the agent. |
ADDITIONAL POST PARAMETERS
You may also POST any of the following parameters:
Parameter | Description |
---|---|
licenseNumber | The license number of the agent license being created. |
licenseStateAbbrev | The 2-letter state abbreviation of the agent license being created. |
licenseResidenceState | The residence state of the agent license being created. Boolean - True or False. |
licenseEffectiveDate | The effective date of the agent license being created. Please format as 'mm/DD/yyyy'. |
licenseExpirationDate | The expiration date of the agent license being created. Please format as 'mm/DD/yyyy'. |
licenseQualifications | The qualifications of the agent license being created. This will be a comma-separated text of the ‘agent_qualification’ lookup value. Any value included that is not a current lookup value will be created. |
licenseNotes | The notes of the agent license being created. |
attachment_file_body_1 |
The file contents as a base64 encoded string. Any non-empty, base64 encoding that is invalid will not be accepted and the file will not be attached. |
attachment_file_url_1 | A valid URL where a file attachment can be downloaded from. When provided, we download the file and attach to the agent license. Must start with “http://” or “https://”. Anything else will be ignored. |
attachment_file_name_1 |
The filename of the uploaded file. Invalid characters in the filename may be replaced and filenames may be shortened under certain conditions. Invalid characters include:
*Required if the file body or file url are passed in. |
When sending dates via POST, please ensure that the dates are formatted as 01/01/2013
.
Custom Fields
The REST API allows access to the custom fields inside your account when creating a new agent license. 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/agent-license/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 agent license inside your AMS+ account, you will get a return status of 200 along with the agentLicenseID as seen below.
{ "Agencybloc Response": { "Status":"200", "agentID":"123456", "Action":"create" } }
Update
RESOURCE URI
https://app.agencybloc.com/api/v1/agents/licenses/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 |
---|---|
agentLicenseID | The ID of the agent license that is being updated. |
ADDITIONAL POST PARAMETERS
You may also POST any of the following parameters:
Parameter | Description |
---|---|
licenseNumber | The license number of the agent license being updated. |
licenseStateAbbrev | The 2-letter state abbreviation of the agent license being updated. |
licenseResidenceState | The residence state of the agent license being updated. Boolean - True or False. |
licenseEffectiveDate | The effective date of the agent license being updated. Please format as 'mm/DD/yyyy'. |
licenseExpirationDate | The expiration date of the agent license being updated. Please format as 'mm/DD/yyyy'. |
licenseQualifications | The qualifications of the agent license being updated. This will be a comma-separated text of the ‘agent_qualification’ lookup value. Any value included that is not a current lookup value will be created. |
licenseNotes | The notes of the agent license being updated. |
attachment_file_body_1 |
The file contents as a base64 encoded string. Any non-empty, base64 encoding that is invalid will not be accepted and the file will not be attached. |
attachment_file_url_1 | A valid URL where a file attachment can be downloaded from. When provided, we download the file and attach to the agent license. Must start with “http://” or “https://”. Anything else will be ignored. |
attachment_file_name_1 |
The filename of the uploaded file. Invalid characters in the filename may be replaced and filenames may be shortened under certain conditions. Invalid characters include:
*Required if the file body or file url are passed in. |
When sending dates via POST, please ensure that the dates are formatted as 01/01/2013
.
Custom Fields
The REST API allows access to the custom fields inside your account when updating an agent license. 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/agent-license/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 an agent inside your AMS+ account, you will get a return status of 200 along with the groupID as seen below.
{ "Agencybloc Response": { "Status":"200", "agentID":"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" } } }
Download
RESOURCE URI
https://app.agencybloc.com/api/v1/agents/licenses/license-download
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 |
---|---|
agentLicenseID | The ID of the agent license that you’re requesting to download the license file. |