-
Notifications
You must be signed in to change notification settings - Fork 1
/
subscription-apis.http
108 lines (92 loc) · 4.13 KB
/
subscription-apis.http
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
@baseUrl=https://marketplaceapi.microsoft.com
@api_version=2018-08-31
@client_id=
@client_secret=
@tenant_id=
@marketplace_token=
@subscription={{resolve.response.body.$.subscription.id}}
#########################################################################################
# @name getBearerToken
#
POST https://login.microsoftonline.com/{{tenant_id}}/oauth2/token HTTP/1.1
content-type: application/x-www-form-urlencoded
client_id={{client_id}}
&client_secret={{client_secret}}
&grant_type=client_credentials
&resource=20e940b3-4c77-4b0b-9a53-9e16a1b010a7
#########################################################################################
# @name resolve
#
POST {{baseUrl}}/api/saas/subscriptions/resolve?api-version={{api_version}} HTTP/1.1
Authorization: Bearer {{getBearerToken.response.body.$.access_token}}
Content-Type: application/json
x-ms-marketplace-token: {{marketplace_token}}
#########################################################################################
# @name activate
# Update planId / quantity before use
POST {{baseUrl}}/api/saas/subscriptions/{{subscription}}/activate?api-version={{api_version}} HTTP/1.1
Authorization: Bearer {{getBearerToken.response.body.$.access_token}}
Content-Type: application/json
{
"planId": "GOLD"
}
#########################################################################################
# @name getSubscriptions
#
GET {{baseUrl}}/api/saas/subscriptions?api-version={{api_version}} HTTP/1.1
Authorization: Bearer {{getBearerToken.response.body.$.access_token}}
Content-Type: application/json
#########################################################################################
# @name getSubscription
#
GET {{baseUrl}}/api/saas/subscriptions/{{subscription}}?api-version={{api_version}} HTTP/1.1
Authorization: Bearer {{getBearerToken.response.body.$.access_token}}
Content-Type: application/json
#########################################################################################
# @name patchSubscriptionChangePlan
# Update planId before use
PATCH {{baseUrl}}/api/saas/subscriptions/{{subscription}}?api-version={{api_version}} HTTP/1.1
Authorization: Bearer {{getBearerToken.response.body.$.access_token}}
Content-Type: application/json
{
"planId": "metered"
}
#########################################################################################
# @name checkPatchSubscriptionChangePlanSuccess
#
GET {{patchSubscriptionChangePlan.response.headers.Operation-Location}}
Authorization: Bearer {{getBearerToken.response.body.$.access_token}}
Content-Type: application/json
#########################################################################################
# @name patchSubscriptionChangeQuantity
# Update quatity before use
PATCH {{baseUrl}}/api/saas/subscriptions/{{subscription}}?api-version={{api_version}} HTTP/1.1
Authorization: Bearer {{getBearerToken.response.body.$.access_token}}
Content-Type: application/json
{
"quantity": 5
}
#########################################################################################
# @name checkPatchSubscriptionChangeQuantitySuccess
#
GET {{patchSubscriptionChangeQuantity.response.headers.Operation-Location}}
Authorization: Bearer {{getBearerToken.response.body.$.access_token}}
Content-Type: application/json
#########################################################################################
# @name deleteSubscription
#
DELETE {{baseUrl}}/api/saas/subscriptions/{{subscription}}?api-version={{api_version}} HTTP/1.1
Authorization: Bearer {{getBearerToken.response.body.$.access_token}}
Content-Type: application/json
#########################################################################################
# @name checkDeleteSubscriptionSuccess
#
GET {{deleteSubscription.response.headers.Operation-Location}}
Authorization: Bearer {{getBearerToken.response.body.$.access_token}}
Content-Type: application/json
#########################################################################################
# @name listAvailablePlans
#
GET {{baseUrl}}/api/saas/subscriptions/{{subscription}}/listAvailablePlans?api-version={{api_version}} HTTP/1.1
Authorization: Bearer {{getBearerToken.response.body.$.access_token}}
Content-Type: application/json