Download OpenAPI specification:Download
The Hub API is a REST API which provides access to all of Nuvias Hub functions for customers to use.
This API provides access to all of the functions normally available in Hub.
Note : Access to Hub API requires that you have a credit account with Nuvias UC and are a reseller or service provider entitled to purchase from distribution. For more information on setting up an account, see this page.
The API has predictable resource-oriented URLs, accepts only JSON-encoded request bodies, returns JSON-encoded responses and uses standard HTTP response codes, authentication and verbs.
You can use this API, subject to the terms below, to access your data in Hub and perform the actions you normally would be able to based on your access permissions.
We subscribe to the principles of semantic versioning. Patch and minor releases are backwardly compatible, but this does require you to be flexible in handling our API - we may add optional fields to endpoints or add additional data in a response as part of a minor release.
You can access specific versions of the API by specifying the version as part of the path.
Older versions of the API are available for at least 6 months after the release of a new version although we may extend this in some circumstances.
Hub is multi-tier so you can represent your descendant organisations (e.g. customers or resellers) in Hub and allow them to perform actions. Access to data in Hub is determined by the organisation that you authenticate as
When describing multi-tier operations:
For example: In the following organisation chain A > B > C > D > E: B is the parent of C, A and B are the ancestors of C, D is the child of C, D and E are the descendants of C.
We offer this API as a whitelabel service to our customers. If you're interested in this, get in touch with your account manager.
The API is provided without formal support, however we have put together some resources to help.
First of all, check our Developer site where we publish the latest information and help available to developers, including the latest release notes.
You can also log in to Hub itself an review how the user interface works - the API is developed alongside the interface and so you can see how we're using the API and the data.
The Hub API uses OAuth 2.0 as an authentication mechanism. To use the API you must first create an API client through the web interface for the user you wish to authenticate as. When this is complete, a Client ID and Client Secret will be displayed - please note the Secret is only displayed once.
Hub uses the Client Credentials Grant Type, requiring the API client to send a POST request to the token endpoint, along with the client ID and secret as described here. This endpoint then returns an access token and expiry time.
Subsequent requests to the API should then use the token in the Authorization header of the request in the format Authorization: Bearer thesecretapitoken
.
Creates OAuth token from API client credentials. This OAuth token can then be used to access the rest of the API.
client_id required | string API client ID (UUID) |
client_secret required | string API client secret |
grant_type required | string Value: "client_credentials" Grant type, currently only client credentials supported |
OK
Request body incorrect
Credentials error
Live
client_id=123e4567-e89b-12d3-a456-426614174000&client_secret=abcdefgh1234567&grant_type=client_credentials
{- "access_token": "abc123",
- "token_type": "Bearer",
- "expires_in": 3600
}
Gets details about the currently authenticated user. If emulation is in progress, then all returned information (other than the real_id and real_name) will be about the emulated user.
Authenticated user
Permission denied
Live
{- "id": 5,
- "name": "Tom Jones",
- "organisation": 5,
- "real_id": 1,
- "real_name": "Diana Ross",
- "currency": "GBP",
- "locale": "en",
- "timezone": "Europe/London",
- "admin": false,
- "root": false,
- "modules": [
- "WEBSTORE"
], - "permissions": [
- {
- "permission": "user:view",
- "parent": false
}
]
}
Gets a list of organisations
list of organisations
Permission denied
Live
[- {
- "id": 1,
- "name": "Bob's Widgets",
- "parent": 5,
- "linked_account": false,
- "finance_type": "AGENT"
}
]
Get list of saved addresses for organisation
id required | integer |
List of addresses
Permission denied
Not found
Live
[- {
- "name": "Main office",
- "company_name": "Bob's Widget's Ltd.",
- "recipient_name": "Bob Johnson",
- "addr_line_1": "123 Example Close",
- "addr_line_2": "Main Street",
- "city": "London",
- "region": "City of London",
- "postal_code": "AB12 3AA",
- "country_code": 829
}
]
Retrieve a list of products, paginated according to the per_page
attribute. You can use a combination of the attributes in any way to filter the list.
Note that the text
parameter allows you to specify a string with which to search against the product name and also the product code or SKU. To retrieve the ID of a product if you know its SKU, simply use the text
parameter with the SKU. Note that SKU or product code is not guaranteed to be unique across multiple vendors.
page | integer Default: 1 Example: page=2 The page of results to retrieve |
per_page | integer Default: 1000 Example: per_page=100 The maximum number of results to return per page |
vendor | Array of integers Example: vendor=5 Filter by an array of vendor IDs. -1 can be used to filter by records with no vendor assigned |
type | Array of integers Example: type=10 Filter by an array of product type IDs. -1 can be used to filter by records with no product type |
text | string Example: text=2200-123-123 Filter by name or product code |
sort_by | Array of strings Default: "-popularity" Items Enum: "-popularity" "-name" "+name" "-price" "+price" Example: sort_by=-popularity Order to sort results by. + indicates ascending, - indicates descending |
List of products
Permission denied
Live
[- {
- "id": 1,
- "name": "A New Phone",
- "product_code": "NEW-PH0N3",
- "description": "100 Lines, Full Colour, Makes Toast Too",
- "detailed_description": "This phone is everything you need in a new device. It makes toast, orders lunch, and even has been known to save lives*\n*T&Cs apply",
- "featured_description": "100 lines\nFull colour screen\nIn-built toaster",
- "vendor": 5,
- "type": 10,
- "rrp": 110.12,
- "price": 100.12,
- "thumb_url": "string",
- "main_image_url": "string",
- "datasheet_url": "string",
- "guide_url": "string",
- "quickstart_url": "string",
- "stock": 9001,
- "provisioning": [
- {
- "id": 1,
- "sku": "123-4567-1200",
- "name": "Phone maintenance",
- "price": 12.34,
- "dovetail": false
}
], - "maintenance": [
- {
- "id": 1,
- "sku": "123-4567-1200",
- "name": "Phone maintenance",
- "price": 12.34,
- "dovetail": false
}
], - "shipping_cost": 20,
- "subscription_type": "DROPBOX",
- "rate_plans": [
- {
- "id": 1,
- "name": "Monthly Gold",
- "term_length": 24,
- "billing_frequency": "monthly",
- "renewal_term_length": 12,
- "default": true,
- "min_quantity": 1,
- "max_quantity": 100,
- "rate_plan_charges": [
- {
- "id": 1,
- "name": "Monthly maintenance fee",
- "charge_type": "recurring",
- "charge_model": "per_unit",
- "rate_plan_charge_costs": [
- {
- "id": 1,
- "currency": "GBP",
- "charge_cost_price": 4.99
}
], - "unit_of_measure": "User"
}
]
}
], - "is_shippable": false,
- "is_financeable": false
}
]
Gets a product by its ID
id required | integer ID of product |
Product information
Permission denied
Not found
Live
{- "id": 1,
- "name": "A New Phone",
- "product_code": "NEW-PH0N3",
- "description": "100 Lines, Full Colour, Makes Toast Too",
- "detailed_description": "This phone is everything you need in a new device. It makes toast, orders lunch, and even has been known to save lives*\n*T&Cs apply",
- "featured_description": "100 lines\nFull colour screen\nIn-built toaster",
- "vendor": 5,
- "type": 10,
- "rrp": 110.12,
- "price": 100.12,
- "thumb_url": "string",
- "main_image_url": "string",
- "datasheet_url": "string",
- "guide_url": "string",
- "quickstart_url": "string",
- "stock": 9001,
- "provisioning": [
- {
- "id": 1,
- "sku": "123-4567-1200",
- "name": "Phone maintenance",
- "price": 12.34,
- "dovetail": false
}
], - "maintenance": [
- {
- "id": 1,
- "sku": "123-4567-1200",
- "name": "Phone maintenance",
- "price": 12.34,
- "dovetail": false
}
], - "shipping_cost": 20,
- "subscription_type": "DROPBOX",
- "rate_plans": [
- {