Session: Login
The login process consists of creating a session using the Infobip username and password. Upon successful session creation the API will return a session token. The token can be used for authenticating all subsequent API calls. If the token is not used for more than an hour it expires and a new session needs to be created.
Resource
https://api.infobip.com/auth/1/session
Parameters
| Property name | Type | Description |
|---|---|---|
| username* | string | Your Infobip username. |
| password* | string | Your Infobip password. |
Request Example
POST /auth/1/session HTTP/1.1
Host: api.infobip.com
Content-Type: application/json
Cache-Control: no-cache
{
"username": "username",
"password": "password"
}
Response
{
"token": "2f9b4d31-2d0d-49a8-85f0-9b862bdca394"
}
| Parameter | Type | Description |
|---|---|---|
| token | String | Use this token for authentication. The token expires after one hour of inactivity. |
Send SMS example
This example shows how to use the token for authentication with a simple SMS example.
POST /sms/1/text HTTP/1.1
Host: api.infobip.com
Content-Type: application/json
Authorization: IBSSO 2f9b4d31-2d0d-49a8-85f0-9b862bdca394
Cache-Control: no-cache
{
"text": "Simple SMS message",
"from": "INFOSMS",
"to": "41793026727"
}