Login

POST /api/v1/login/
Try to authenticate a user and create a session.
The sessionid cookie returned has to be propagated in the cookies of further requests.
Depending on the network architecture, additional cookies for load distribution returned would have to be propagated in the cookies of further requests.

Example request:

POST /api/v1/login/ HTTP/1.1
Host: example.com
Content-Type: "application/json"

{
   "username": "ApioUser1@sip.netaxis.be",
   "password": "IAmAStrongPassword"
}
Request JSON Object:
  • username (string) – the username to be authenticated

  • password (string) – the password of the user

  • provide_basic_profile (optional, DEPRECATED) (boolean) – Boolean flag to request to get a basic profile information (to avoid having to fetch it after the login). This flag is no more used, these information are always returned.

Example response:

HTTP/1.1 200 OK
Content-Type: "application/json"
Set-Cookie: sessionid=0123456780

{
   "ids": {
      "tenant_id": "Apio",
      "group_id": "ApioGroup",
      "user_id": "ApioUser1@sip.netaxis.be"
   },
   "profile" : {
      "user_level": 8,
      "is_first_login": true
   }
}
Response JSON Object:
  • ids (object) – The list of ids of the connected user defined as Ids attributes, to be used by the client to build further API urls. Of course only ids relevant for the type of user connected are returned

  • profile (object) – Some properties of the profile as defined in Login profile attributes. The optional parameters are only present if relevant.

Status Codes:

Ids attributes

Name

Present

Type

Description

tenant_id

optional

String

The identifier of the tenant.

group_id

optional

String

The identifier of the group.

user_id

optional

String

The identifier of the end user.

Login profile attributes

Name

Present

Type

Description

user_level

always

Int

The access rights level of the user. 0: End User, 4: Department Admin, 8: Group Admin, 12: Tenant Admin, 16: System Admin

is_first_login

always

Boolean

The fact that is the first login ever of the user

broadsoft_type

optional

String

The type of Broadsoft user (if the main AS is Broadsoft)

username

optional

String

The identifier of the user. It can be present for example after a SSO login From version 1.11.0 it will always be returned.

first_name

optional

String

The first name of the user.

last_name

optional

String

The last name of the user.

language

optional

String

The language of the user.

language_code

optional

String

The associated language code. See Language and language code.

emailAddress

optional

String

The email of the user.

access_type

optional

Int

The access level of the user: 0:Normal, 1: Restricted (ex. Reseller), 3: Super (meaning access to special APIO resources)

read_only

optional

Boolean

The fact that the user has a readonly access

user_type

optional

String

A logical type name of the user if relevant

is_expired

optional

Boolean

An indication that the user credentials are expired. The login is accepted but all requests, except password change or logout, will be rejected

expires_in

optional

Int

The number of days before the login expires, if login expiration is enabled.

backendName

optional

String

The name of the NE Backend hosting this user.

backendExternalName

optional

String

A logical/external name of the NE Backend hosting this user.

phoneNumber

optional

String

The phone number of the End User if any (only in login answer).

role

optional

String

The Role associate to the user (if one defined), no logic associated in the GW.

is_enterprise

optional

Boolean

The fcagt that the user is in an Enterprise or not (if available and relevant).

The backendName and backendExternalName will be provided if available and if the APIO has been configured to do so:

"PROVIDE_BACKEND_INFO": true
Explanation of the parameters:
  • PROVIDE_BACKEND_INFO: If true and if the user profile has a main_server then its name will be provided. Default is false as it is disclosing some network set-up information. Note that it is useful onlhy in case of multi-as configuration