Admin/Authentication

Admin authentication.

STAGING_URL: https://switchapi3.azurewebsites.net
LIVE_URL: https://switchapi.azurewebsites.net

Login

POST https://switch-api-staging.herokuapp.com/admin/login

Authenticates admin and returns a valid token used for session validation.

Headers

Name
Type
Description

SWI-CS

string

Payload checksum

SWI-CID

string

Client ID

Request Body

Name
Type
Description

email

string

admin email

password

string

admin password

{
    "message": "Admin login successful",
    "data": {
        "auth_token": "eyJhbGciOiJIUzI1NiJ9.eyJhZG1pbl9pZCI6MTEsImV4cCI6MTU2Mjc2NTE3MSwiY29udGV4dCI6ImFkbWluIn0.gfGI47XH148fTfYMZSmcgYboDFpzOmPbWdPj2hkn1kY",
        "admin": {
            "id": 11,
            "email": "cs@switch.ng",
            "role": "customer_success",
            "disabled": false,
            "has_changed_password": true,
            "password_expired": false
        }
    }
}

Logout

POST https://switch-api-staging.herokuapp.com/admin/logout

Invalidates the admin's session token.

Headers

Name
Type
Description

SWI-CID

string

Client ID

Authorization

string

Format is Bearer token

{
    "message": "User session invalidated"
}

Last updated

Was this helpful?