Older versionVersion 2.7Developer integration guidesUsing PhenixID HTTP API to send SMS

Using PhenixID HTTP API to send SMS

Overview

To use the API, one method is called. It will return:

- HTTP Status code 200 if SMS was sent ok.

- HTTP Status code 403 if SMS could not be sent

Prerequisites

- PhenixID Authentication Services HTTP API configured for "send SMS" use case

Authentication

The API is always protected by authentication. The authentication mechanism may differ in different environments. It can be basic authentication, client certificate authentication or oAuth2 Bearer token.

Please consult the PhenixID administrator in your environment to find information about authentication method.

Data to be fetched before api call

The api client must fetch these values:

- mobile - The mobile phone number to where the SMS will be sent. Can be on format +46xxxxxxxxx or 0xxxxxxxxx.

- message - The SMS text to be sent.

 How these parameter are fetched may differ depending on the use case.

sendSMS - api call

Request

Method: HTTP PUT

Endpoint: /api/authentication/sendSMS

Headers:

Name Value
Mandatory Comment
Content-Type application/json Yes
tenant t1 Yes .Value must be given to you by PhenixID Signing Service admin, it might differ depending on the environment.
Authorization Bearer <access_token>

OR

Basic authentication string
No

Body:

{ "mobile":"<mobile_phone_number>", "message" : "<SMS_text>" }

Example request

 

PUT /api/authentication/sendSMS HTTP/1.1
Host: integration.phenixid.se
tenant: t1
Content-Type: application/json
cache-control: no-cache

{ "mobile":"+467012345678", "message" : "Please buy some milk on your way home." }

 

 

Response

The API consumer must check the http response status code.

Possible http response status codes

1. 200. SMS has been sent (or at least accepted by the SMS provider).

2. 403. SMS could not be sent. Please contact your PhenixID admin.