REST API: Activities
Using the REST API, you can create new activities within your AMS+ account.
Activities Resources
Activity Resources
Create
RESOURCE URI
https://app.agencybloc.com/api/v1/activities/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, individual, agent, carrier, or lead) the activity will be created under. |
| entityTypeID | The entity type you are attaching the activity to. |
The entityTypeID parameter must be one of the following values:
- Group
- Individual
- Agent
- Carrier
- Lead
| Parameter | Description |
|---|---|
| statusLookupID* | The status of the new activity being created in your AMS+ account. This value will populate the 'Status' dropdown within the 'Append' section of the new activity being created. |
| typeLookupID* | The type of the new activity being created in your AMS+ account. This value will populate the 'Type' dropdown within the 'Append' section of the new activity being created. |
| methodLookupID* | The method of the new activity being created in your AMS+ account. This value will populate the 'Method' dropdown within the 'Append' section of the new activity being created. |
| priorityLookupID* | The priority of the new activity being created in your AMS+ account. This value will populate the 'Priority' dropdown within the 'Append' section of the new activity being created. |
| activityDate | The date of the activity; if omitted, it will default to the current date. Please format as 'mm/DD/yyyy'. |
| subject | The subject of the activity (up to 250 characters) |
| notes | The notes of the activity (long description) |
ADDITIONAL POST PARAMETERS
If the statusLookupID you have passed is not 'Complete' then you will need to assign follow-up user, follow-up date and follow-up start/end times.
Along with each activity, you can also post up to 5 files (optional). For each file, a filename must be supplied as well as a valid URL or base64 encoded file.
Also, we only accept certain file types. See the Accepted File Types section for the full list.
| Parameter | Description | Parameter Collection |
|---|---|---|
| followUpUserID | The follow-up userID assigned to the new activity that is being created in your AMS+ account. | - |
| followUpDate | The follow-up date of the new activity being created in your AMS+ account. This value will populate the 'Follow-up Date' textbox within the new activity being created. Please format as 'mm/DD/yyyy'. | - |
| followUpAllDay | The follow-up all day flag of the new activity being created in your AMS+ account. | - |
| followUpStartTime | The start time of the new activity being created in your AMS+ account. Please format as 'HH:MM:SS'. | - |
| followUpEndTime | The end time of the new activity being created in your AMS+ account. Please format as 'HH:MM:SS'. | - |
| relatedPolicyID |
The ID of the policy being related to the new activity. Only for groups and individuals. If you enter a policy ID that is not associated with the specified group or individual, we will leave this field blank. If you enter a policy ID that is not in your account, then the activity will not be created. |
- |
| attachment_file_url_1 |
A valid URL where the file attachment can be downloaded from. Must start with “http://” or “https://”. Anything else will be ignored. |
1 |
| 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. |
1 |
| 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:
|
1 |
| attachment_file_url_2 |
A valid URL where the file attachment can be downloaded from. Must start with “http://” or “https://”. Anything else will be ignored. |
1 |
| attachment_file_body_2 |
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. |
1 |
| attachment_file_name_2 |
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:
|
1 |
| ... |
... |
... |
| attachment_file_url_5 |
A valid URL where the file attachment can be downloaded from. Must start with “http://” or “https://”. Anything else will be ignored. |
1 |
| attachment_file_body_5 |
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. |
1 |
| attachment_file_name_5 |
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:
|
1 |
When sending dates via POST, please ensure that the dates are formatted as 01/01/2013. When sending times via POST, please ensure that the times are formatted as 24 hour time. For 8AM use: 08:00:00. For 5PM use: 17:00:00.
Accepted File Types
We allow the following file types: .bmp, .csv, .doc, .docm, .docx, .eml, .gif, .gz, .htm, .html, .jpeg, .jpg, .log, .m4a, .mp3, .mp4, .msg, .numbers, .pages, .pdf, .png, .pps, .ppt, .pptx, .pub, .rtf, .TIF, .tiff, .txt, .vcf, .wav, .wmv, .wps, .xls, .xlsb, .xlsm, .xlsx, and .zip.
RESPONSE
A return response will be generated after you have consumed the API. Upon successfully creating a new activity inside your AMS+ account, you will get a return status of 200 along with the activityID as seen below.
{
"Agencybloc Response": {
"Status":"200",
"activityID":"123456",
"Action":"create"
}
}
Exceptions 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"
}
}
}
List
RESOURCE URI
https://app.agencybloc.com/api/v1/activities/list
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, individual, agent, carrier, or lead) the activity will be created under. |
| entityTypeID | The entity type you are attaching the activity to. |
The entityTypeID parameter must be one of the following values:
- Group
- Individual
- Agent
- Carrier
- Lead
RESPONSE
The response will be the full detail of the activities associated with the entity selected.
[
{
"activity_id":1111,
"activity_date":"2019-01-21",
"subject":"Lorem Ipsum",
"notes":"Lorem ipsum dolor sit amet.",
"status":"In Progress",
"type":"Renewal",
"method":"Email",
"priority":"Medium",
"related_policy_id":0,
"FU_user_id":0,
"FU_user_first_name":"Firstname",
"FU_user_last_name":"Lastname",
"FU_team_name":"Team Name",
"followup_allday":0,
"FU_date":"2019-01-01",
"FU_UTC_start_time":"14:00:00",
"FU_UTC_end_time":"15:00:00"
}
]
Note: If you want the full follow-up date and time, you will need to concatenate FU_date with the corresponding FU_UTC start/end time when consuming the API.
Exceptions 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"
}
}
}
REST API: Activity
List
RESOURCE URI
https://app.agencybloc.com/api/v1/activity/list
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 |
|---|---|
| activityIDs | A comma separated string of activity_id(s) that are to be returned from your AMS+ account. Note: If access to any of the activity id(s) that are sent in is denied, we will return an exception that shows which activity id you don't have access to. |
RESPONSE
The response will be the full detail of the activities associated with the entity selected.
[
{
"activity_id":1111,
"activity_date":"2019-01-21",
"subject":"Lorem Ipsum",
"notes":"Lorem ipsum dolor sit amet.",
"status":"In Progress",
"type":"Renewal",
"method":"Email",
"priority":"Medium",
"related_policy_id":0,
"FU_user_id":0,
"FU_user_first_name":"Firstname",
"FU_user_last_name":"Lastname",
"FU_team_name":"Team Name",
"followup_allday":0,
"FU_date":"2019-01-01",
"FU_UTC_start_time":"14:00:00",
"FU_UTC_end_time":"15:00:00"
}
]
Note: If you want the full follow-up date and time, you will need to concatenate FU_date with the corresponding FU_UTC start/end time when consuming the API.
Exceptions 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"
}
}
}