SharePoint

Updated 5 years ago

  1. Create a workflow and open it in SharePoint designer
  2. Use the ClickSend v2 http API. There are two methods that work with SharePoint workflows: 
    1. (preferred)      Authenticate in header and POST the phone number (TO) and MESSAGE
      • https://api-mapper.clicksend.com/rest/v2/send.json?method=http
    2. (not preferred) Authenticate in      header and add TO and MESSAGE to the URL
      • https://api-mapper.clicksend.com/rest/v2/send.json?method=http&to=61411111111&message=Hello  NOTE: This method is less preferable as  it requires URL-encoded phone number and message.
  3. The Parameters are:

The base URl variant of the API that will return JSON which SharePoint requires

https://api-mapper.clicksend.com/rest/v2/send.json

This URI that works for testing from the browser:  (This works but exposes the password).

https://api-mapper.clicksend.com/http/v2/send.php?method=http&username=aaaaaaaaaa&key=bbbbbbbbbb&to=61411111111&message=hello

(replace aaaa and bbbb with your username and API key).

SharePoint Workflow details:

The workflow will end up looking like this and will be explained further below.

  1. Build a dictionary containing these three items:

Authorization: string: Basic base64 encoded username and password in the format {username}:{password} more info: https://developers.clicksend.com/docs/rest/v3/#authentication

Username and Password can be found here:
https://dashboard.clicksend.com/#/account/subaccount

Accept: string: application/json;odata=verbose

Content-Type: application/json;odata=verbose 

  1. Build a dictionary containing the phone number (TO) and the message.  This is the one you will need to fill :

to: string: +6411111

message: String: your message here 

Workflow now looks like this: 

  1. Call an http web service using the variable "Messages" containing TO and MESSAGE that you just built.

As indicated by the red dots you can create a new variable for each response item to use for logging or control.

  1. Add the Authorisation and other items of the first dictionary variable to the request headers
    1. Highlight  the http call and use the dropdown arrow to find properties and set. 



How Did We Do?

Powered by HelpDocs (opens in a new tab)