Follow ups

Our API allow clients to create and complete Follow ups on the Lead Manager using activities. To create a Follow up use the created_a_followup_for activity, see the example below:

curl -X POST 'https://receivers.leadrouter.realgeeks.com/rest/sites/{site-uuid}/leads/{lead-id}/activities' -v \
    -u 'user:password' \
    -d '[{
            "type": "created_a_followup_for",
            "user": {"id": "14187"},
            "metadata": {
                "event": {
                    "id": "e22ae128-7a7f-473b-9103-ef7433bbedea",
                    "title": "Call client",
                    "description": "Ask for areas of interest",
                    "happens_at": "2018-01-15T12:27:00-10:00",
                    "purpose": "Call",
                    "reminders": [
                        {"time_before": "2", "unit": "hours"},
                        {"time_before": "10", "unit": "minutes"}
                    ]
                }
            }
        }]'

Note how we are still using the standard Activities endpoint. The user field is required to indicate which agent in the Lead Manager created this Follow up.

A new field is now used, metadata, which in turn has an event. Here is a list with all fields available for event:

Field Type Description
id string (required) Unique ID, generate one using the UUID format. Will be used to complete the follow up later
title string (required)
description string (required)
happens_at string (required) Date and time of this Follow up. Format must be a combined date and time according to ISO 8601, ex.: “2018-01-15T12:27:00-10:00”
purpose string (required) One of the same values you have in your Lead Manager: “Call”, “BombBomb”, “Email”, “Marking”, “Text” or “Other”
all_day boolean (optional)
reminders list of objects (optional) Each object must have time_before(integer) and unit(string) keys. Possible units are: “minutes”, “hours”, “days” and “weeks”

It’s also possible to complete a follow up using the completed_a_followup_for activity. In this case all you need is the same event id sent to create:

curl -X POST 'https://receivers.leadrouter.realgeeks.com/rest/sites/{sire-uuid}/leads/{lead-id}/activities' -v \
    -u 'user:password' \
    -d '[{
            "type":"completed_a_followup_for",
            "metadata": {
                "event": { "id": "e22ae128-7a7f-473b-9103-ef7433bbedea" }
            }
        }]'