Skip to main content

Subscriptions Report

To get an overview of the services associated with your accounts, you can iterate through all your active subscriptions which, being a central resource, provide links to most essential service-related resources. Using our HAL implementation, you can request the API to embed these linked resources into the subscriptions, providing one-stop access to all this information.

note

When embedding one resource into another, not all of its information may be included. You'll need to individually retrieve a linked resource if you require specific information from it that wasn't embedded into the subscriptions.

To control which resources to embed, use the transclude preference with the links you need, separated by semicolons. Example:

Prefer: transclude="account;sim_profile"

You can transclude all subscriptions' linked resources:

  • account
  • subscriber
  • sim_profile
  • phone_numbers
  • services

Include the Prefer header with your required configuration and list your subscriptions:

curl -X GET \
https://api.1global.com/enterprise/subscriptions?status=active \
-H 'Authorization: Bearer $ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-H 'Prefer: transclude="account;sim_profile"'

You'll get:

{
"_embedded": {
"subscriptions": [
{
"id": "sub_01HXD62QCP3P9TZV8ZW45D6HB7",
"status": "active",
"created_at": "2024-01-01T00:00:00Z",
"_embedded": {
"account": {
"id": "acc_01HXD63DQBVSNYQ408NXP181FV",
"reference_code": "123456789",
"name": "Account A",
"country": "US"
},
"sim_profile": {
"iccid": "8999999999999999999",
"sim_type": "esim",
"_links": {
"self": {
"href": "https://api.1global.com/enterprise/subscriptions/sub_01HXD62QCP3P9TZV8ZW45D6HB7/sim-profile"
}
}
}
},
"_links": {
"self": {
"href": "https://api.1global.com/enterprise/subscriptions/sub_01HXD62QCP3P9TZV8ZW45D6HB7"
},
"phone_numbers": {
"href": "https://api.1global.com/enterprise/subscriptions/sub_01HXD62QCP3P9TZV8ZW45D6HB7/phone-numbers"
},
"services": {
"href": "https://api.1global.com/enterprise/subscriptions/sub_01HXD62QCP3P9TZV8ZW45D6HB7/services"
}
}
}
]
},
"_links": {
"self": {
"href": "https://api.1global.com/enterprise/subscriptions?cursor=z731nwgxxn&limit=10&status=active"
},
"next": {
"href": "https://api.1global.com/enterprise/subscriptions?cursor=1haobi4n9y1&limit=10&status=active"
}
}
}

Continue iterating through the next result pages until you've covered all your subscriptions.