-
Notifications
You must be signed in to change notification settings - Fork 0
Api: Endpoints
This section assumes you have completed an authenticated request and hold a valid token to make data requests. For more info on how to authenticate before you make API requests, visit the authentication page.
Current version of the API is 1.0
Prefix for all endpoints:
https://onscri.be/api/v1
These are all the endpoints available, sorted below based on their leading path:
All endpoints are under the /product
namespace.
With application-level OAuth2, the product
is the connected entity - you get its details by simply calling:
/product
To get the details of any (other) product, append its common id:
/product/:id
As an extension of the product
namespace you can request product related collections.
To list the subscribers of a product
/product/:id/subscriptions
To list the providers of a product
/product/:id/providers
A collection endpoint for listing all available products.
/products
The scope of the products
is defined differently based on the type of token used:
- With a CLI token it is the full list of products of the user that matches the username/password in the
.onscribe
config - With a user-auth token it is the products of the logged in user
This endpoint is not supported for an application-level token.
A very limited dataset is released to describe providers, when you already know its common id. This is mostly used to find out the provider type.
/provider/:id
A collection endpoint for listing all available providers.
/providers
The scope of the providers
is defined differently based on the type of token used:
- With an application-level token it is the providers supported by the product
- With a CLI token it is the full list of providers of the user that matches the username/password in the
.onscribe
config - With a user-auth token it is the providers of the logged in user
All endpoints are under the /subscription
namespace.
To get the details of a single subscription simply append its common id:
/subscription/:id
Note that only the owner of the product or the user that has subscribed has access to this information.
A collection endpoint for listing all available subscriptions.
/subscriptions
The scope of the subscriptions
is defined differently based on the type of token used:
- With an application-level token it is the subscriptions of the product
- With a CLI token it is the full list of subscriptions of the user that matches the username/password in the
.onscribe
config - With a user-auth token it is the subscriptions of the logged in user
All endpoints are under the /user
namespace.
To get the details of the currently logged in user simply use:
/user
```
The ```user``` is defined differently based on the type of token used.
* With an application-level token it is the owner of the product
* With a CLI token it is the user that matches the username/password in the ```.onscribe``` config
* With a user-auth token it is the logged in user
To get the details of any (other) user, simply append its _common_ id:
```
/user/:id
```
#### Collections
As an extension of the user namespace you can request user related collections.
To request a user's products:
```
/user/:id/products
```
To request a user's subscriptions:
```
/user/:id/subscriptions
```
Where ```id`` is the _common_ id of the user.
### Disabled endpoints
The following endpoints are intentionally not implemented, as their application doesn't justify the security risk.
```
/user/:id/providers
/users
```