How to manage subscriptions
TIP
You can test our APIs without authorization by targetting sandbox.api.wgtwo.com
instead of api.wgtwo.com
and removing any authorization from the request/code sample.
Get subscription info
# Access token must be obtained via the client credentials flow
curl -s \
-H "Authorization: Bearer ${ACCESS_TOKEN}" \
https://api.wgtwo.com/subscription/v2/msisdn/46737678218
1
2
3
4
2
3
4
Install dependencies
Maven
<dependency>
<groupId>com.wgtwo.api</groupId>
<artifactId>rest</artifactId>
<version>1.2.1</version>
</dependency>
package com.wgtwo.examples.provision
import com.wgtwo.api.rest.ApiClient
import com.wgtwo.api.rest.handler.SubscriptionProfileApi
private val apiClient = ApiClient().apply {
setUsername("CLIENT_ID")
setPassword("CLIENT_SECRET")
}
private val subscriptionProfileApi = SubscriptionProfileApi(apiClient)
fun main() {
val subscription = subscriptionProfileApi.getSubscription("47xxxxxxxx")
println("My enabled services: ${subscription.services!!.keys}")
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Activate new user
# Access token must be obtained via the client credentials flow
curl \
-H "Authorization: Bearer ${ACCESS_TOKEN}" \
-H 'Content-Type: application/json' \
-d '
{
"bssid": "operator_name",
"iccid": "2420198416000015720",
"msisdn": "46737678218",
"userid": "random-userid-123"
}
' \
https://api.wgtwo.com/provision/v2/activate
1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
Provision replacement SIM
Depending on the logistics of getting a new SIM just using /provision/v2/changesim
can also work, since the old SIM already becomes nonfunctional after changesim.
Steps
Block subscription
# Access token must be obtained via the client credentials flow
curl \
-H "Authorization: Bearer ${ACCESS_TOKEN}" \
-H 'Content-Type: application/json' \
-d '
{
"bssid": "operator_name",
"msisdn": "46737678218"
}
' \
https://api.wgtwo.com/provision/v2/block
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
Change SIM
# Access token must be obtained via the client credentials flow
curl \
-H "Authorization: Bearer ${ACCESS_TOKEN}" \
-H 'Content-Type: application/json' \
-d '
{
"bssid": "operator_name",
"iccid": "2420198416000015720",
"newIccid": "2420198412148748973"
}
' \
https://api.wgtwo.com/provision/v2/changesim
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
Unblock subscription
# Access token must be obtained via the client credentials flow
# Can also use IMSI or ICCID as identifier
curl \
-H "Authorization: Bearer ${ACCESS_TOKEN}" \
-H 'Content-Type: application/json' \
-d '
{
"bssid": "operator_name",
"msisdn": "46737678218"
}
' \
https://api.wgtwo.com/provision/v2/unblock
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
Freeze subscription
Unfreeze subscription
Restrict highspeed data
# Access token must be obtained via the client credentials flow
curl \
-H "Authorization: Bearer ${ACCESS_TOKEN}" \
-H 'Content-Type: application/json' \
-d '
{
"bssid": "operator_name",
"services": {
"delete": ["DATA_HIGHSPEED"]
},
"msisdn": "46737678218"
}
' \
https://api.wgtwo.com/provision/v2/update
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
Disable roaming
Steps
Remove roaming
# Access token must be obtained via the client credentials flow
curl \
-H "Authorization: Bearer ${ACCESS_TOKEN}" \
-H 'Content-Type: application/json' \
-d '
{
"bssid": "operator_name",
"services": {
"delete": ["ROAMING"]
},
"msisdn": "46737678218"
}
' \
https://api.wgtwo.com/provision/v2/update
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
Remove roaming data
# Access token must be obtained via the client credentials flow
curl -s \
-H "Authorization: Bearer ${ACCESS_TOKEN}" \
-H 'Content-Type: application/json' \
-d '
{
"bssid": "operator_name",
"services": {
"delete": ["ROAMING_DATA"]
},
"msisdn": "46737678218"
}
' \
https://api.wgtwo.com/provision/v2/update
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
Install dependencies
Maven
<dependency>
<groupId>com.wgtwo.api</groupId>
<artifactId>rest</artifactId>
<version>1.2.1</version>
</dependency>
package com.wgtwo.examples.provision
import com.wgtwo.api.rest.ApiClient
import com.wgtwo.api.rest.handler.SubscriptionProfileApi
import com.wgtwo.api.rest.model.UpdateSubscriptionRequest
import com.wgtwo.api.rest.model.UpdateSubscriptionRequestService.NameEnum
private val apiClient = ApiClient().apply {
setUsername("CLIENT_ID")
setPassword("CLIENT_SECRET")
}
private val subscriptionProfileApi = SubscriptionProfileApi(apiClient)
fun main() {
val request = UpdateSubscriptionRequest().apply {
bssid = "IDENTIFIER PROVIDED BY WORKING GROUP TWO"
msisdn = "47xxxxxxxx"
services = UpdateSubscriptionRequestServices().apply {
delete = listOf(NameEnum.ROAMING_DATA)
}
}
subscriptionProfileApi.updateService(request)
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Enable roaming
Steps
Add roaming
# Access token must be obtained via the client credentials flow
curl \
-H "Authorization: Bearer ${ACCESS_TOKEN}" \
-H 'Content-Type: application/json' \
-d '
{
"bssid": "operator_name",
"services": {
"add": [
{ "servicename": "ROAMING" }
]
},
"msisdn": "46737678218"
}
' \
https://api.wgtwo.com/provision/v2/update
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Add roaming data
# Access token must be obtained via the client credentials flow
curl -s \
-H "Authorization: Bearer ${ACCESS_TOKEN}" \
-H 'Content-Type: application/json' \
-d '
{
"bssid": "operator_name",
"services": {
"add": [
{ "servicename": "ROAMING_DATA" }
]
},
"msisdn": "46737678218"
}
' \
https://api.wgtwo.com/provision/v2/update
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Install dependencies
Maven
<dependency>
<groupId>com.wgtwo.api</groupId>
<artifactId>rest</artifactId>
<version>1.2.1</version>
</dependency>
package com.wgtwo.examples.provision
import com.wgtwo.api.rest.ApiClient
import com.wgtwo.api.rest.handler.SubscriptionProfileApi
import com.wgtwo.api.rest.model.UpdateSubscriptionRequest
import com.wgtwo.api.rest.model.UpdateSubscriptionRequestService.NameEnum
private val apiClient = ApiClient().apply {
setUsername("CLIENT_ID")
setPassword("CLIENT_SECRET")
}
private val subscriptionProfileApi = SubscriptionProfileApi(apiClient)
fun main() {
val request = UpdateSubscriptionRequest().apply {
bssid = "IDENTIFIER PROVIDED BY WORKING GROUP TWO"
msisdn = "47xxxxxxxx"
services = UpdateSubscriptionRequestServices().apply {
add = listOf(
UpdateSubscriptionRequestServices.add().apply {
servicename = NameEnum.ROAMING_DATA
},
)
}
}
subscriptionProfileApi.updateService(request)
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Terminate subscription
# Access token must be obtained via the client credentials flow
# Can also be terminated using IMSI or ICCID as identifier
curl \
-H "Authorization: Bearer ${ACCESS_TOKEN}" \
-H 'Content-Type: application/json' \
-d '
{
"bssid": "operator_name",
"msisdn": "46737678218"
}
' \
https://api.wgtwo.com/provision/v2/terminate
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
Change MSISDN for a SIM
# Access token must be obtained via the client credentials flow
# Can also use IMSI or ICCID as identifier instead of MSISDN
curl \
-H "Authorization: Bearer ${ACCESS_TOKEN}" \
-H 'Content-Type: application/json' \
-d '
{
"bssid": "operator_name",
"msisdn": "46737678218",
"newMsisdn": "46727678209"
} ' \
https://api.wgtwo.com/provision/v2/changemsisdn
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
Remove a SIM from subscription
# Access token must be obtained via the client credentials flow
curl \
-H "Authorization: Bearer ${ACCESS_TOKEN}" \
-H 'Content-Type: application/json' \
-d '
{
"bssid": "operator_name",
"msisdn": "46737678218",
"iccid": "2420198416000015720"
}
' \
https://api.wgtwo.com/provision/v2/disengagesim
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
Add a bundled product
# Access token must be obtained via the client credentials flow
curl \
-H "Authorization: Bearer ${ACCESS_TOKEN}" \
-H 'Content-Type: application/json' \
-d '
{
"bssid": "operator_name",
"services": {
"add": [
{
"servicename": "PRODUCT_BUNDLING",
"config": {
"products": ["some_product_id"]
}
}
]
},
"msisdn": "46737678218"
}
' \
https://api.wgtwo.com/provision/v2/update
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21