# Get Prepaid Plans

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

# Request Configuration

# Request Endpoint

/api/Activation/PostpaidPlans

# 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 CAD.
carrier string Use R for Rogers, T for Telus, and B for Bell.
promocode string Use PromoCode returned from VerifySimcard

# Request Body

None

# Sample Reqeust

# Sample Request URL

http://localhost:8080/api/Activation/PrepaidPlans?currency=CAD&carrier=T&promocode=MyPromoCode

# cURL

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

# Python - Requests

import requests

url = 'https://testmyaccount.azurewebsites.net/api/PrepaidPlans?currency=CAD&carrier=T&promocode=MyPromoCode%0A'

payload = {}
headers = {
  'client': 'TestAPI',
  '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://testmyaccount.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: 11/5/2020, 2:36:22 AM