Skip to content

Api: Endpoints

✌ Makis Tracend edited this page Jan 27, 2015 · 1 revision

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.

Version

Current version of the API is 1.0

Prefix for all endpoints:

https://onscri.be/api/v1

Paths

These are all the endpoints available, sorted below based on their leading path:

Product

All endpoints are under the /product namespace.

Models

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

Collections

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

Products

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.

Provider

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

Providers

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

Subscription

All endpoints are under the /subscription namespace.

Model

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.

Subscriptions

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

User

All endpoints are under the /user namespace.

Model

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
```
Clone this wiki locally