Send a RCS

To simplify job creation, Docoon REST API provides to you a specific resource per media. For RCS jobs only the resource is called “RCSJobs”.

We will review how to send quickly a RCS with one recipient or many recipients. We will also review the RCS advanced parameters and the text personnalisation of the message.

When the RCS job request is accepted, you will get a jobNumber, it means a job was accepted and was put in the appropriate queue (depending on your priority defined in your contract), we will send the message to each recipient as soon as possible depending of the current traffic.

When the job is finished, you will be able to check the transmission status of each recipient, check “Get transmission reports” easy worflow for more information.

Send RCS request informations

Name: /RCSJobs
Type: POST

Headers:

NameValue
AuthorizationValue : Authorization token check : Connect to REST API
Content-TypeValue : application/json

Parameters list:

ParameterTypeDescription
JobTypeStringJobType you want to use (‘RCS’ for RCS Sending).
TrackingIDString(Optional) String of your choice, as a reference for the job (shown in the summary and in your billing).
LaunchTypeInteger(Optional) Choose your type of sending 0 = Send your message , 1 = Do a proof , 2 = Do a preview.
ScheduledStartTimeString(Optional) Choose a date to schedule your job.Example : ‘2017-06-08T03:50:25.355Z’
RcsMessageFileReferenceA valid Json composing your RCS message
AdhocRecipientsList of AdhocRecipients(Optional can be replace by List File)
List of AdhocRecipients: List of the recipients for the sending, see below for the AdhocRecipients Structure.
ListsList of FileReference(Optional can be replace by AdhocRecipients)
List of FileReference: Used for the recipient list.
List format: .xlsx, .xls, .csv, .tab.
your list should at least contained the phone number in the first column (default setting), then it is up to you to fill the other column.
ParameterRCSParameterAvanced parameters for RCS sending (see below).

Structure details of AdhocRecipients

This Object is used to list your recipient in the “AdhocRecipients”

ParameterTypeDescription
NameStringName or Id of your recipient.
AddressStringAddress/Phone number of your recipient.
OptionalFieldsList of StringList of additionnal information of your recipient (Last Name, Birth date, Country, …) .
The first 5 items of the list will be included in the reports.
It is also possible to use these elements to personalize the messages.
If you want to add the first item of this list use ‘BCF3 (then ‘BCF4, 5 etc..).
`BCF1 = Value inserted into the field “Address” and `BCF2 = Value inserted into the field “Name”.

Send Basic RCS

{
    "JobType": "RCS", 
    "RcsMessage": 
    {
        "Type": 1,
        "Name": "rcsMessage.json",
        "Hosted": false,
        "Content":      "ewogICAgInRleHRfbWVzc2FnZSI6IHsKICAgICAgInRleHQiOiAiVGhpcyBpcyBhIHRleHQgbWVzc2FnZS4iCgl9Cn0="
    },
    "TrackingId": "Send Basic RCS", 
    "AdhocRecipients": [ { "Name": "Dupont", "Address": "00337xxxxxx" } ] 
}

RCS advanced parameters description

In addition to the parameters presented above, there are advanced parameters allowing to configure specific parameters to RCS sending (sender address, content encoding, shorturl activation, …).

ParameterTypeDescription
MediaIntegerType of media used
7: RCS (Always this value for RCS sending).

Use advanced parameters

{
    "JobType": "RCS", 
    "RcsMessage": 
    {
        "Type": 1,
        "Name": "rcsMessage.json",
        "Hosted": false,
        "Content":   "ewogICAgInRleHRfbWVzc2FnZSI6IHsKICAgICAgInRleHQiOiAiVGhpcyBpcyBhIHRleHQgbWVzc2FnZS4iCgl9Cn0="
    },
    "TrackingId": "Send RCS with advanced parameters", 
    "Parameter": { "Media": 7 },
    "AdhocRecipients": [ { "Name": "Dupont", "Address": "00337xxxxxx" } ] 
}

Send a RCS using a file list

You can also use a file list for your recipient. You will have to replace the “AdhocRecipients” list by a “Lists” of File Reference (see the structure below). List format accepted : .xlsx, .xls, .csv, .tab.

By Default, the phone number should be in the first column of the first (and only) sheets of your file.
The other columns can be used for personalizations.

Structure details of FileReference

ParameterTypeDescription
NameStringName of the file with extension (abc.xls).
ContentStringFile content encoded in BASE64.
HostedBoolean(Optional) True: if the file is hosted in your hosted lists file (Docoon hosted list), False: if not.
MimeTypeString(Optional) If the file’s MIME type is defined. Else, the system will associate a MIME type based on the file extension.
TypeIntegerSelect your document type
0 = List

Use file list

{
    "JobType": "RCS", 
    "RcsMessage": 
    {
        "Type": 1,
        "Name": "rcsMessage.json",
        "Hosted": false,
        "Content":      "ewogICAgInRleHRfbWVzc2FnZSI6IHsKICAgICAgInRleHQiOiAiVGhpcyBpcyBhIHRleHQgbWVzc2FnZS4iCgl9Cn0="
    },
    "TrackingId": "Send RCS with file list", 
    "Lists": [ { "Name": "test.tab", "Hosted": false, "Type":0, "Content": "77u/MDAzMzc4Tg3OA==" } ] 
}

Sucessful response

Status: 200 : OK

Parameters list:

ParameterTypeDescription
JobNumberintID of the job created

Sucessful response { “JobNumber”: 44608862 }

Error response

Status: 400: Bad request

ParameterTypeDescription
MessageStringSpecification of the problem.
ModelStatelist of jobList of job (String error).

Error response { “Message”: “The request is invalid.”, “ModelState”: { “job”: [ “An error has occurred.” ] } }

More Usage Examples

Scheduled job

{
    "JobType": "RCS", 
    "RcsMessage": 
    {
        "Type": 1,
        "Name": "rcsMessage.json",
        "Hosted": false,
        "Content":      "ewogICAgInRleHRfbWVzc2FnZSI6IHsKICAgICAgInRleHQiOiAiVGhpcyBpcyBhIHRleHQgbWVzc2FnZS4iCgl9Cn0="
    },
    "TrackingId": "Send Basic RCS", 
    "ScheduledStartTime": "2019-01-01T00:00:00.688Z",
    "AdhocRecipients": [ { "Name": "Dupont", "Address": "00337xxxxxx" } ] 
}

RCS message JSON structure

The following examples must be BASE64 encoded and put into the “Content” of the “RcsMessage” property.

Text message

{
    "text_message": {
      "text": "Test message"
    }
}

Media message

{
    "media_message": {
      "url": "https://exemple.url/logo.png"
    }
}

Choice message

{
    "choice_message": {
        "text_message": {
            "text": ""
        },
        "choices": [
        {
            "text_message": {
                "text": "Confirm"
            }
        },
        {
            "text_message": {
                "text": "Cancel"
            }
        }
        ]
    }
}

Card message

{
    "card_message": {
        "title": "Test title",
        "description": "Test message",
        "media_message": {
            "url": "https://exemple.url/logo.png"
        },
        "choices": [
        {
            "text_message": {
                "text": "Click here"
            }
        }
        ]
    }
}

Carousel message

{
    "carousel_message": {
        "cards": [
        {
            "title": "Text title",
            "description": "",
            "media_message": {
            "url": "https://exemple.url/logo.png"
        },
        "choices": [
        {
            "text_message": {
                "text": "Sign up here"
            }
        }
        ]
    },
    {
        "title": "Visit our website",
        "description": "",
        "media_message": {
            "url": "https://exemple.url/logo.png"
        },
        "choices": [
            {
                "url_message": {
                    "title": "Website",
                    "url": "https://docoon.com"
                }
            }
            ]
        },
        {
            "title": "Call our customer support line",
            "description": "",
            "media_message": {
                "url": "https://exemple.url/logo.png"
            },
            "choices": [
            {
                "call_message": {
                    "title": "Support line",
                    "phone_number": "+33XXXXX"
                }
            }
            ]
        }
        ] 
    }
}

Location message

{
    "location_message": {
        "title": "Your ride is here!",
        "label": "Meet your driver.",
        "coordinates": {
            "latitude": 55.610479,
            "longitude": 13.002873
        }
    }
}