Obtain Private Key
Using Onboarding Interface
To integrate with the API, you must create a Google Cloud Project. After that create a service account and obtain a private key. To get started, click the following button:
Manually Generating Key
If the above interface fails, please try the following:
- Go to Google Cloud Console.
- Choose the project using which the API will be accessed.
- Under the IAM & admin menu on the left, find service accounts and create a new Service Account which will be the owner of the project.
- Once the service account is created, you should receive a private key.
Whitelist Service Account
Once you have created a service account:
- Reach out to GTAF team at firstname.lastname@example.org with a Google account which is the owner of the project. We will whitelist the Google account to access the Mobile Data Plan Sharing API endpoints.
- Associate service account with the carrier on Google ISP Portal. The carrier can make this association by going to API Access.
Once the whitelisting has been done:
- Visit Google Cloud Console.
- Make sure you've selected the correct project in the dropdown on the top menu bar.
- Enable Mobile Data Plan Sharing API in the API Library.
- Enable Preprod Mobile Data Plan Sharing API in the API Library.
Test API Access
To test your access to Google side methods:
Obtain an access token for your service account as follows.
your-service-account-key-file.jsonis a key file of your service account.
> oauth2l fetch --json your-service-account-key-file.json dataplansharing
Note that the access token expires in about one hour. Before you run above command again for a new access token, run
oauth2l resetto clear the local cache.
Issue test calls as follows.
YOUR-ASNmust be one of the ASNs you send to us when we configured GTAF during the integration process.
ACCESS-TOKEN-OBTAINEDis the output of above
oauth2l fetchcommand. PLAN_STATUS is the PlanStatus request body you are looking to send to GTAF.
> url_domain="mobiledataplansharing.googleapis.com" > url_path="v1/operators/YOUR-ASN/clients/mobiledataplan/users/USER_KEY/planStatus" > curl -H "Content-Type: application/json" \ -d 'PLAN_STATUS' \ -X POST "https://$url_domain/$url_path?access_token=ACCESS-TOKEN-OBTAINED"
Programmatic API calls
Follow the instructions to make authorized calls to Google side methods, with the following OAuth scope:
Sharing Project Ownership
While the initial set up involves a single Google account, it is a good idea to for a group of authorized users to have ownership of the project. On Google Cloud Console, under IAM & admin menu, you can add new members (including Google groups account) to be owners of the project.