# Login

This request is used for partners to login and obtain access tokens.

If you don't remember your login credential, contact our PhoneBox Account managers.

# Request Configuration

# Request Endpoint

/api/Partner/Login

# Request Method

POST

# Request Headers

None

# Request Parameters

None

# Request Body

Name Type Description
username string your user name aquired from PhoneBox Account Manager
password string your paswword aquired from PhoneBox Account Manager

# Sample Reqeust

# Sample Request Body

{
    "username": "PhoneBox",
    "password": "secrete"
}

# cURL

curl --location --request POST 'https://phoneboxapi.azurewebsites.net/api/Partner/login' \
--header 'Content-Type: application/json' \
--data-raw '{
  "username": "PhoneBox",
  "password": "secrete"
}'

# Python - Requests

import requests
url = "https://phoneboxapi.azurewebsites.net/api/Partner/login"
payload = "{\r\n  \"username\": \"PhoneBox\",\r\n  \"password\": \"secrete\"\r\n}"
headers = {
  'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data = payload)
print(response.text.encode('utf8'))

# NodeJs -Axios

var axios = require('axios');
var data = JSON.stringify({"username":"PhoneBox","password":"%secrete"});
var config = {
  method: 'post',
  url: 'https://phoneboxapi.azurewebsites.net/api/Partner/login',
  headers: { 
    'Content-Type': 'application/json'
  },
  data : data
};
axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});

# Response

# Success

return a nonzero AdId, not null Token, and nonzero bID

"{\"AaId\":9999,\"Token\":\"HBgsY7562EhdG7j+9Px4RoSwL7cCDsXH\",\"bID\":9999,\"isTmpPwd\":null}"

# Fail

return zero AdId, null Token, and zero bID

reason: wrong login credential

"{\"AaId\":0,\"Token\":null,\"bID\":0,\"isTmpPwd\":null}"
LastUpdated: 5/30/2024, 1:34:33 PM