Get company subscription features#

This endpoint is used to get subscription features information from a subscribed plan.

Endpoint steps#

  1. Get a token from your credentials by calling the endpoint Account/getToken;

  2. Get subscription features information calling the endpoint Subscriptions/{subscriptionId}/features from WebStore API URL.

Response structure from server#

When a request is well formed and the authentication data is correct the system responds with a message envelope as follows:

{
	"CorrelationId": "<GUID>", /* for correlation purposes */
	"IsValid": true,           /* false in case of erros */
	"Errors": [],              /* if empty is a good signal */
	"Data": "<Service Response Data>"   /* the data retuned ex: token, invoice status, dependent on the endpoint called */
}

Endpoint Server Base URL#

# SANDBOX - Test Environment
webstore_server_base_adress = "dcn-solution.saphety.com/Dcn.Sandbox.WebApi"

# Saphety Invoice Network - Production Environment
#webstore_server_base_adress = "dcn-solution.saphety.com/IN2.WebStore.WebApi"

1. Get a token (Account/getToken)#

Get a token from your account credentials using endpoint api/Account/getToken
Check here how to obtain an authentication token.

2. Get Subscription Features (Subscriptions/{subscriptionId}/features)#

2.1 Request structure#

In the endpoint url you need to supply the subscription id

subscriptionId#

  • Description: The subscription unique identification (GUID)

  • Required: Yes

  • Type: string

  • Example: “ad152107-78f6-4d07-9e87-b130bbee296c”

2.2 Request example#

# WebStore endpoint url for retrieving information
service_url = "https://" + webstore_server_base_adress + "/api/Subscriptions/" + "ad152107-78f6-4d07-9e87-b130bbee296c" + "/features"
print (service_url)
https://dcn-solution.saphety.com/Dcn.Sandbox.WebApi/api/Subscriptions/ad152107-78f6-4d07-9e87-b130bbee296c/features

2.3 Call the endpoint to get the subscription features#

headers = {
    'Authorization': 'bearer ' + token
}
response = requests.request("GET", service_url, headers=headers)

# formating the response to json for visualization purposes only
json_response = json.loads(response.text)
print(json.dumps(json_response["Data"], indent=4))
[
    {
        "SubscriptionId": "ad152107-78f6-4d07-9e87-b130bbee296c",
        "FeatureCode": "SignSendStoreDocument",
        "EndsWithFeature": null,
        "Limitless": false,
        "RemainingAmount": 48,
        "StartAmount": 50
    }
]

This endpoint is usefull to check how many documents you started with (StartAmount) and how many you still have left to use (RemainingAmount).