Auth module
API Authorization
POST
/login Generates API user token or 2FA code
This endpoint generates one time API user token which needs to be included in
API user token expires after 15 minutes of inactivity. For the purpose of keeping your API user token valid you can periodically (for example every 5 minutes) send GET request to
To obtain API user token valid email address and password needs to be submitted.
Authorization
(Basic) header of all API requests.API user token expires after 15 minutes of inactivity. For the purpose of keeping your API user token valid you can periodically (for example every 5 minutes) send GET request to
/ping
endpoint.To obtain API user token valid email address and password needs to be submitted.
Parameters
JSON body attributes:
email string
password string
remember_me boolean
device_fingerprint string
Example Request
POST /v1.1/voipstudio/login HTTP/1.1 Host: l7api.com { "email": "email@example.com", "password": "$ecretPa$$", "remember_me": true, "device_fingerprint": "abcd" }
Responses
200 Success
400 Validation error
400 Validation error
Example Response
Example success response:
HTTP/1.1 200 OK Content-Type: application/json {"message":"Login success","user_token":"abcdefgh0123456789","user_id":10002}Example error response:
HTTP/1.1 400 Bad Request Content-Type: application/json {"message":"Invalid email and\/or password.","errors":[]}
POST
/login2fa Verifies 2FA code and nonce to generate API Tokeb
This endpoint generates one time API user token which needs to be included in
API user token expires after 15 minutes of inactivity. For the purpose of keeping your API user token valid you can periodically (for example every 5 minutes) send GET request to
To obtain API user token valid email address and password needs to be submitted.
Authorization
(Basic) header of all API requests.API user token expires after 15 minutes of inactivity. For the purpose of keeping your API user token valid you can periodically (for example every 5 minutes) send GET request to
/ping
endpoint.To obtain API user token valid email address and password needs to be submitted.
Parameters
JSON body attributes:
code string
nonce string
add_device boolean
remember_me boolean
Example Request
POST /v1.1/voipstudio/login2fa HTTP/1.1 Host: l7api.com { "code": "abcd", "nonce": "abcd", "add_device": true, "remember_me": true }
Responses
200 Success
400 Validation error
400 Validation error
Example Response
Example success response:
HTTP/1.1 200 OK Content-Type: application/json {"message":"Login success","user_token":"abcdefgh0123456789","user_id":10002}Example error response:
HTTP/1.1 400 Bad Request Content-Type: application/json {"message":"Invalid code and\/or nonce.","errors":[]}
POST
/logout Destroys API user token
This endpoint explicitly destroys user token which otherwise would expire after 15 minutes of inactivity.
Parameters
No parameters
Example Request
POST /v1.1/voipstudio/logout HTTP/1.1 Host: l7api.com
Responses
200 Success
401 Unauthorized
401 Unauthorized
Example Response
*Example success response:
HTTP/1.1 200 OK Content-Type: application/json {"message":"Logout success"}*Example error response:
HTTP/1.1 401 Unauthorized Content-Type: application/json {"message":"Authentication Failed. ApiToken with user_token: 'abc123' does not exist","errors":[]}
GET
/ping API user token keepalive ping
This endpoint can be used to periodically refresh user token in order to keep it valid if there are no other requests to be made within 15 minutes timeout window.
Parameters
No parameters
Example Request
GET /v1.1/voipstudio/ping HTTP/1.1 Host: l7api.com
Responses
200 Success
Example Response
*Example success response:
HTTP/1.1 200 OK Content-Type: application/json {"message":"Pong"}
POST
/confirmation Allows user to resend confirmation email
Parameters
JSON body attributes:
email string
User e-mail to resend confirmation e-mail.
User e-mail to resend confirmation e-mail.
Example Request
POST /v1.1/voipstudio/confirmation HTTP/1.1 Host: l7api.com { "email": "email@example.com" }
Responses
200 Success
400 Validation error
400 Validation error
Example Response
POST
/password Starts user password reset procedure
Parameters
JSON body attributes:
email string
User e-mail for password reset.
User e-mail for password reset.
Example Request
POST /v1.1/voipstudio/password HTTP/1.1 Host: l7api.com { "email": "email@example.com" }
Responses
200 Success
400 Validation error
400 Validation error
Example Response
POST
/reset Allows user to set new password
Parameters
JSON body attributes:
token string
Token from e-mail.
Token from e-mail.
password string
New password.
New password.
Example Request
POST /v1.1/voipstudio/reset HTTP/1.1 Host: l7api.com { "token": "abcd", "password": "$ecretPa$$" }
Responses
200 Success
400 Validation error
400 Validation error
Example Response
GET
/aclroles Returns collection of ACL roles resources
Parameters
No parameters
Example Request
GET /v1.1/voipstudio/aclroles HTTP/1.1 Host: l7api.com
Responses
200 Success
401 Unauthorized
401 Unauthorized
Example Response
HTTP/1.1 200 OK Content-Type: application/json { "data": [ { "id": 902, "_name": "value", "name": "value", "product_code": "value" } ], "total": 59 }
GET
/aclroles/{id} Returns ACL roles resource for given Id
Parameters
Endpoint URL:
{id} integerAclRole2 identifier
Example Request
GET /v1.1/voipstudio/aclroles/51 HTTP/1.1 Host: l7api.com
Responses
200 Success
401 Unauthorized
403 Access denied
404 Resource not found
401 Unauthorized
403 Access denied
404 Resource not found
Example Response
HTTP/1.1 200 OK Content-Type: application/json { "data": { "id": 5233, "_name": "value", "name": "value", "product_code": "value" }, "links": {} }