API
Introduction
Your web site can talk directly to Vision Commerce to send and receive information using our API.
How it works
Your web site talks directly to our API, it submits data in XML format directly to it. Depending on your license, data can also be retrieved to be displayed on your site.
The API listens and when it receives inbound information it either:
Stores what it received into a temporary area in Vision Commerce (see: Vision Interfaces screen). If your system is configured this way, from the Vision Commerce 'Interfaces' screen you can accept the information into Vision (for example by double clicking a customer or order to load the data and then manually save).
Or it can be configured to post the records direct into the system without the need for any manual intervention, see: Admin - API Interface Maintenance.
Licensing options available
License | Post customers to Vision | Post orders to Vision | Get data from Vision | Get ‘Images’ from Vision | Notes |
---|---|---|---|---|---|
API In (Cheapest) |
|
|
|
| Your website can post new / updated customer information into Vision and also new orders. No information can be retrieved from Vision electronically. Can be used with the ‘Legacy CSV’ option to get data from Vision Web Extract CSV |
API Standard Limited |
|
| * |
|
Many more outputs available here than with the “Legacy CSV” option. E.g. your website makes a request for stock information, once per day should you want to refresh. Our API supplies all the information in one response which you would load into your web site. Posted customers / orders are unlimited. This type of connectivity requires external licensing which is why it is more expensive, and also increased security. |
API Enhanced Limited |
|
| * |
|
As above (“API Standard Limited”) plus access to the ‘Image’ APIs so you can store and retrieve product and producer images in the commerce system which are automatically available to your website. Although data retrieval is limited, Image retrieval is unlimited. |
API Enhanced (Most expensive) |
|
|
|
| As above (“API Enhanced Limited”) without limits; your website is always up to date. Requesting the information on a real time basis requires a server and connection powerful enough to sustain the requests it could receive, due to this this is the most expensive. |
Authentication
We use OWIN OAuth 2.0 token authentication to authenticate with our API. The process is quite simple, initially you have to generate a token using your username, password and client_id provided by us see token. You'll be provided with a token and a refresh_token in the response, then you access our API using the token in every request you make to us. When the token expires you can create a new one using the refresh_token.
API List
Generic response / error codes
Code | Description |
---|---|
200 | Success |
400 | Bad request
|
401 | Authentication failed, please check the token / secret used and that you have access to the requested service |
404 | Service not found |
500 | Internal server error
please contact the Ontech support team if this occurs |
999 | An error occurred in the requested service |
Samples to help with your integration
Call a Web API From a .NET Client (C#)
Test with Postman
Install Postman
Visit www.getpostman.com and download the version of Postman required for your platform
Install Postman
Import Request Collection
Download VC_API Auth2.postman_collection.json
Open Postman
Click Import, click Choose Files and specify VC_API Auth2.postman_collection.json. An import success message appears for each collection imported
Edit the collection to set value for variable VCURL, replace it with your API URL
Call token request to get access_token after replacing client_id, username, and password in the request body
The access token will saved variable 'AccessToken', which is attached on all request
Start using other APIs
For more information please refer
https://learning.postman.com/getting-started/
https://www.guru99.com/postman-tutorial.html
Copyright Ontech Solutions 2017-2024. All rights reserved, no part may be replicated or distributed without the express permission of the owner.