Integration Guide
Stay organized with collections
Save and categorize content based on your preferences.
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:
Create Service Account
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 mdp-support@google.com 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.
Enable Library
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:
- Install
oauth2l
.
Obtain an access token for your service account as follows.
your-service-account-key-file.json
is 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 reset
to clear the local
cache.
Issue test calls as follows. YOUR-ASN
must be one of the ASNs you send
to us when we configured GTAF during the integration process.
ACCESS-TOKEN-OBTAINED
is the output of above oauth2l fetch
command.
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:
https://www.googleapis.com/auth/dataplansharing
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.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-10-03 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-10-03 UTC."],[[["\u003cp\u003eTo integrate with the API, create a Google Cloud Project, a service account, and obtain a private key, potentially using the provided onboarding interface or manual steps.\u003c/p\u003e\n"],["\u003cp\u003eWhitelist the service account by contacting the GTAF team and associating it with the carrier on the Google ISP Portal for API access.\u003c/p\u003e\n"],["\u003cp\u003eEnable the necessary Mobile Data Plan Sharing APIs (both production and preprod) within your Google Cloud Project.\u003c/p\u003e\n"],["\u003cp\u003eTest API access using \u003ccode\u003eoauth2l\u003c/code\u003e to obtain an access token and make authorized calls with the specified OAuth scope.\u003c/p\u003e\n"],["\u003cp\u003eShare project ownership by adding members or Google groups as owners in the IAM & admin section of your Google Cloud Project.\u003c/p\u003e\n"]]],[],null,["# Integration Guide\n\nObtain Private Key\n------------------\n\n### Using Onboarding Interface\n\nTo integrate with the API, you must create a Google Cloud Project. After that\ncreate a service account and obtain a private key. To get started, click the\nfollowing button:\n\nCreate Service Account\n\n### Manually Generating Key\n\nIf the above interface fails, please try the following:\n\n1. Go to [Google Cloud Console](https://console.cloud.google.com/).\n2. Choose the project using which the API will be accessed.\n3. 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.\n4. Once the service account is created, you should receive a private key.\n\nWhitelist Service Account\n-------------------------\n\nOnce you have created a service account:\n\n1. Reach out to GTAF team at [mdp-support@google.com](mailto:mdp-support@google.com) 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.\n2. Associate service account with the carrier on [Google ISP\n Portal](https://isp.google.com/). The carrier can make this association by going to [API Access](https://isp.google.com/api_access/).\n\nEnable Library\n--------------\n\nOnce the whitelisting has been done:\n\n1. Visit [Google Cloud Console](https://console.cloud.google.com).\n2. Make sure you've selected the correct project in the dropdown on the top menu bar.\n3. Enable [Mobile Data Plan Sharing API](https://console.cloud.google.com/apis/library/mobiledataplansharing.googleapis.com/) in the [API Library](https://console.developers.google.com/apis/library).\n4. Enable [Preprod Mobile Data Plan Sharing API](https://console.cloud.google.com/apis/library/preprod-mobiledataplansharing.googleapis.com/) in the [API Library](https://console.developers.google.com/apis/library).\n\nTest API Access\n---------------\n\nTo test your access to Google side methods:\n\n1. Install [`oauth2l`](https://github.com/google/oauth2l).\n2. Obtain an access token for your service account as follows.\n `your-service-account-key-file.json` is a key file of your service account.\n\n \u003e oauth2l fetch --json your-service-account-key-file.json dataplansharing\n\n Note that the access token expires in about one hour. Before you run above\n command again for a new access token, run `oauth2l reset` to clear the local\n cache.\n3. Issue test calls as follows. `YOUR-ASN` must be one of the ASNs you send\n to us when we configured GTAF during the integration process.\n `ACCESS-TOKEN-OBTAINED` is the output of above `oauth2l fetch` command.\n PLAN_STATUS is the\n [PlanStatus](./reference/rest/v1/operators.clients.users.planStatus#PlanStatus)\n request body you are looking to send to GTAF.\n\n \u003e url_domain=\"mobiledataplansharing.googleapis.com\"\n \u003e url_path=\"v1/operators/YOUR-ASN/clients/mobiledataplan/users/USER_KEY/planStatus\"\n \u003e curl -H \"Content-Type: application/json\" \\\n -d 'PLAN_STATUS' \\\n -X POST \"https://$url_domain/$url_path?access_token=ACCESS-TOKEN-OBTAINED\"\n\nProgrammatic API calls\n----------------------\n\nFollow the\n[instructions](https://developers.google.com/identity/protocols/OAuth2ServiceAccount#authorizingrequests)\nto make authorized calls to Google side methods, with the following OAuth scope: \n\n https://www.googleapis.com/auth/dataplansharing\n\nSharing Project Ownership\n-------------------------\n\nWhile the initial set up involves a single Google account, it is a good idea to\nfor a group of authorized users to have ownership of the project. On [Google\nCloud Console](https://console.cloud.google.com/), under IAM \\& admin menu, you\ncan add new members (including Google groups account) to be owners of the\nproject."]]