SharePoint
- Create a workflow and open it in SharePoint designer
- Use the ClickSend v2 http API. There are two methods that work with SharePoint workflows:
- (preferred) Authenticate in header and POST the phone number (TO) and MESSAGE
- https://api-mapper.clicksend.com/rest/v2/send.json?method=http
- (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.
- (preferred) Authenticate in header and POST the phone number (TO) and MESSAGE
- 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.
- 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
- 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:
- 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.
- Add the Authorisation and other items of the first dictionary variable to the request headers
- Highlight the http call and use the dropdown arrow to find properties and set.