API Documentation

This document is a work in progress and your opinion helps us to improve. Please let us know what we can do better. Thanks! support@procurios.com

Contact moments

Registrations of contact between the organization and third parties

Accept header for requests to Contact moments

application/vnd.procurios.contact_moment+json; version=1

Contact moments GET

URL: /l/contact_moment_api/contact_moment

Scope:

contact_moment/view
Last used: Never

Get contact moments

Parameters

Parameter Type Description
page int

The api will provide 25 results per page

since datetime

Only get results created or updated since yyyy-mm-ddThh:mm:ss

relationIds int[]

Limit the results to the given relationIds, as a single integer, comma-separated list of integers, or array of integers

Live testing disabled

Contact moments

Request

json

Response

jsonStatus: 200
[
    {
        "id": 12345,
        "subject": "Test contact moment",
        "senderId": 42,
        "sender": "Douglas Adams",
        "type": "ContactMomentVisit",
        "dateTime": "2020-01-01T01:23:45",
        "action": 1234,
        "tags": {
            "99": "Tag name"
        },
        "recipients": [
            123,
            124,
            126,
            "other relation ids as int"
        ]
    }
]

Schema for a certain type GET

URL: /l/contact_moment_api/contact_moment/type/ContactMomentPhone/schema

Scope:

contact_moment/view
Last used: Never

Get the JSON schema for registering contact moments of a type

Live testing disabled

Schema for a certain type

Request

json

Response

jsonStatus: 200
[
    {
        "$schema": "http:\/\/json-schema.org\/draft-07\/schema#",
        "title": "Contact moment",
        "type": "object",
        "properties": {
            "contactMomentId": {
                "title": "Contact moment ID",
                "description": "The unique ID for the contact moment",
                "type": "integer"
            },
            "subject": {
                "title": "Subject",
                "description": "What the contact moment was about",
                "type": "string"
            },
            "dateTime": {
                "title": "Date and time",
                "description": "yyyy-mm-dd hh:mm:ss",
                "type": "string"
            },
            "senderId": {
                "title": "Sender ID",
                "description": "The Procurios ID of the relation that initiated contact",
                "type": "integer"
            },
            "recipients": {
                "title": "Recipient",
                "description": "The Procurios IDs of the relations that were contacted",
                "type": "array",
                "minItems": 1,
                "uniqueItems": true,
                "items": {
                    "type": "integer"
                }
            },
            "action_code": {
                "title": "Entered via action",
                "type": "integer"
            },
            "reference": {
                "title": "A reference for this contact moment in the calling system.",
                "type": "string",
                "maxLength": 255
            },
            "tagIds": {
                "title": "Tag Ids",
                "description": "The ids of the labels attached to the contact moment for extra information",
                "type": "array",
                "minItems": 0,
                "uniqueItems": true,
                "items": {
                    "type": "integer"
                }
            }
        },
        "required": [
            "subject",
            "senderId",
            "recipients"
        ]
    }
]

Contact moment types GET

URL: /l/contact_moment_api/contact_moment/types

Scope:

contact_moment/view
Last used: Never

Get a list of available contact moment types

Live testing disabled

Contact moment types

Request

json

Response

jsonStatus: 200
[
    {
        "id": "ContactMomentPhone",
        "title": "Telephone call",
        "addable": true,
        "_links": {
            "schema": {
                "href": "link\/to\/schema",
                "type": [
                    "GET"
                ]
            }
        }
    }
]

Tags available to contact moments GET

URL: /l/contact_moment_api/contact_moment/tags

Scope:

contact_moment/view
Last used: Never

Get the available tags to use in contact moments

Live testing disabled

Tags available to contact moments

Request

json

Response

jsonStatus: 200
{
    "3": "Label 1",
    "4": "Label 2",
    "5": "Label 3"
}

Contact moment POST

URL: /l/contact_moment_api/contact_moment/type/ContactMomentPhone

Scope:

contact_moment/write
Last used: Never

Create a new contact moment of a type

Validation

{
    "$schema": "http:\/\/json-schema.org\/draft-07\/schema#",
    "title": "Contact moment",
    "type": "object",
    "properties": {
        "contactMomentId": {
            "title": "Contact moment ID",
            "description": "The unique ID for the contact moment",
            "type": "integer"
        },
        "subject": {
            "title": "Subject",
            "description": "What the contact moment was about",
            "type": "string"
        },
        "dateTime": {
            "title": "Date and time",
            "description": "yyyy-mm-dd hh:mm:ss",
            "type": "string"
        },
        "senderId": {
            "title": "Sender ID",
            "description": "The Procurios ID of the relation that initiated contact",
            "type": "integer"
        },
        "recipients": {
            "title": "Recipient",
            "description": "The Procurios IDs of the relations that were contacted",
            "type": "array",
            "minItems": 1,
            "uniqueItems": true,
            "items": {
                "type": "integer"
            }
        },
        "action_code": {
            "title": "Entered via action",
            "type": "integer"
        },
        "reference": {
            "title": "A reference for this contact moment in the calling system.",
            "type": "string",
            "maxLength": 255
        },
        "tagIds": {
            "title": "Tag Ids",
            "description": "The ids of the labels attached to the contact moment for extra information",
            "type": "array",
            "minItems": 0,
            "uniqueItems": true,
            "items": {
                "type": "integer"
            }
        }
    },
    "required": [
        "subject",
        "senderId",
        "recipients"
    ]
}
Live testing disabled

The sender 9999 is not available in the system

Contact moment

Request

json
{
    "subject": "Retention call",
    "dateTime": "2018-11-13T20:20:39+02:00",
    "senderId": 9999,
    "recipients": [
        429000
    ],
    "contents": "We had a good call and the person decided to stay a member",
    "action_code": 2,
    "reference": "MyReference0123"
}

Response

jsonStatus: 400
{
    "errors": "Sender is not available in CRM"
}

The recipient 9999 is not available in the system

Contact moment

Request

json
{
    "subject": "Retention call",
    "dateTime": "2018-11-13T20:20:39+02:00",
    "senderId": 1516,
    "recipients": [
        9999
    ],
    "contents": "We had a good call and the person decided to stay a member",
    "action_code": 2,
    "reference": "MyReference0123"
}

Response

jsonStatus: 400
{
    "errors": "Not all recipients are available in CRM"
}

Sending a phone call contact moment; mind that "contents" is a phone-specific field!

Contact moment

Request

json
{
    "subject": "Retention call",
    "dateTime": "2018-11-13T20:20:39+02:00",
    "senderId": 1516,
    "recipients": [
        429000
    ],
    "contents": "We had a good call and the person decided to stay a member",
    "action_code": 2,
    "reference": "MyReference0123"
}

Response

jsonStatus: 200
{
    "contactMomentId": 42
}