# Get Prepaid Plans

This service is used to query all prepaid plans belong to the certain partner.

# Request Configuration

# Request Endpoint

/api/Activation/PrepaidPlans

# Request Method

POST

# Request Headers

Name Type Description
client string Use bID returned from Login
apitoken string Use Token returned from Login

# Request Parameters:

Name Type Description
currency string Use Currency returned from VerifySimcard
carrier string Use Carrier returned from VerifySimcard
promocode string Use PromoCode returned from VerifySimcard

# Request Body

None

# Sample Reqeust

# Sample Request URL

https://phoneboxapi.azurewebsites.net/api/Activation/PrepaidPlans?currency=CAD&carrier=T&promocode=MyPromoCode

# cURL

curl --location --request POST 'https://phoneboxapi.azurewebsites.net/api/PrepaidPlans?currency=CAD&carrier=T&promocode=MyPromoCode' \
--header 'client: 1234' \
--header 'apitoken: foqxcFJ82EhecRXnIZbeQbb8m9/dFFHO'

# Python - Requests

import requests

url = 'https://phoneboxapi.azurewebsites.net/api/PrepaidPlans?currency=CAD&carrier=T&promocode=MyPromoCode'

payload = {}
headers = {
  'client': '1234',
  'apitoken': 'foqxcFJ82EhecRXnIZbeQbb8m9/dFFHO',
}

response = requests.request("POST", url, headers=headers, data = payload)

print(response.text.encode('utf8'))

# NodeJs -Axios


var axios = require('axios');

var data = {};

const params = new URLSearchParams({
    currency: 'CAD',
    carrier: 'R',
    promocode: 'MyPromoCode'
}).toString();

const url = "https://phoneboxapi.azurewebsites.net/api/Activation/PrepaidPlans" + params;

axios
    .post(url, data, {
    headers: {
        client: '1234',
        apitoken: 'foqxcFJ82EhecRXnIZbeQbb8m9/dFFHO'
    }
    })
    .then(res => {
        console.log(JSON.parse(res.data));
    })
    .catch(err => {
        console.log(err);
    });

# Response

# Success

return a list of JSON containing below information

[
    {
        "PlanId": 666,
        "Currency": "CAD",
        "Fee": 45.00,
        "Calling": "Unlimited Nation-wide Calling",
        "Message": "Unlimited Nation-wide & International Messages",
        "Data": 5242880.00,
        "PlanTypeD": "30",
        "Carriers": "T",
        "dataOverRate": "$15.00 / 1GB"
    },
    {
        "PlanId": 888,
        "Currency": "CAD",
        "Fee": 60.00,
        "Calling": "Unlimited Nation-wide Calling",
        "Message": "Unlimited Nation-wide & International Messages",
        "Data": 8388608.00,
        "PlanTypeD": "30",
        "Carriers": "T",
        "dataOverRate": "$15.00 / 1GB"
    }
]

# Fail

Failed Authorization

reason: wrong login credential

{
    "Message": "Authorization has been denied for this request."
}
LastUpdated: 5/30/2024, 1:34:33 PM