Get Subscription Contract(s)
Subscriber Getting All Subscription Contracts
Get all contracts
When you subscribe to a policy, you have an active subscription contract with the policy owner (data custodian). If you have subscribed to one or more policies, you can get the list of all subscription contracts by sending a GET request to /v1/subscriptions/
Get a contract by policyId
To get your subscription contract for one policy, you can send a GET request to /v1/subscriptions?policyId={policyId}. "policyId" can be obtained from the create policy response or get policies response
Response
A successful GET /v1/subscriptions/ request returns:
- status code 200
- a collection of all subscription contracts. Each contract contains:
- policyId (the ID of the policy)
- policyName (the name of the policy)
- category (the policy category)
- subscriptionType (the type of subscription)
- subscriptionFee (the cost of the policy subscription)
- participantType (the participant type of the policy owner)
- email (the email address of the policy publisher)
- status (the subscription status: ACTIVE or INACTIVE)
An example of a succesful response would look like:
{
"grid": [
{
"uuid": "string",
"appId": "string",
"appName": "string",
"appType": "string",
"category": "string",
"subCategory": "string",
"subscriberName": "string",
"publisher": "string",
"publisherName": "string",
"participantType": "string",
"monthlyFee": 0,
"usage": "string",
"status": "string"
}
],
"graph": [
{
"appId": "string",
"name": "string",
"uuid": "string",
"source": "string",
"target": "string",
"type": "string",
"subscriptions": "string"
}
]
}
If you are not subscribed to any policies, you will receive the response with status code 204
A failed retrieval response contains a 4xx or 5xx error code with details in the response body. Please refer to this REST API Tutorial for the full list of all HTTP status codes.
Policy Owner Getting All Subscription Contracts
Get all contracts
If you have created one or more policies, you can get the list of all subscribers by sending a GET request to /v1/subscribers/
Get contracts by policyId
To get the list of all subscription contracts for one of your policies, you can send a GET request to /v1/subscibers?policyId={policyId}. "policyId" can be obtained from the create policy response or get policies response.
Get contracts by subscriber email
To get the list of all subscription contracts of one of your subscribers, you can send a GET request with the subscriber's email: /v1/subscribers?email={email}
Get a subscriber's contract for a Policy
The following GET request will get the contract of a subscriber to a particular policy: /v1/subscibers?policyId={policyId}&email={email}
Response
A successful GET /v1/subscribers/ request returns:
- status code 200
-
a collection of all of your policies. Each policy contains:
- policyId (the ID of the policy)
- policyName (the name of the policy)
- category (the policy category)
- subscriptionType (the type of subscription)
- the list of subscribers. Each subscriber contains:
- subscriptionFee (the cost of the subscription)
- participantType (the participant type of the subscriber)
- email (the email address of the subscriber)
- status (the subscription status: ACTIVE or INACTIVE)
A successful response will look like:
{
"uuid": "string",
"appId": "string",
"appName": "string",
"appType": "string",
"category": "string",
"subCategory": "string",
"subscriberName": "string",
"publisher": "string",
"publisherName": "string",
"participantType": "string",
"monthlyFee": 0,
"usage": "string",
"status": "string"
}
If you do not have any subscribers, you will receive the response with status code 204
A failed retrieval response contains a 4xx or 5xx error code with details in the response body. Please refer to this REST API Tutorial for the full list of all HTTP status codes.