API Applications

Tradevine API – Approved User Setup

Here are the steps to start using the Tradevine API. From the Settings menu select API Applications.

1. Select the My Applications button and then select Register new application. image001

2. Provide a name and description and optional link to your website. You can also upload a logo if you intend your application to be used by other Tradevine users.image002

3. Make a note of your Consumer Key and Consumer Secret – these have to always be present in any API calls you make. It identifies your application to us. image003

4. You would now be able to generate your own OAuth request tokens and (after authorisation in the application) access token key/secret pairs for any Tradevine user. The DevDefined OAuth library has samples showing how to do this if authorisation will be initiated by your own system. You can also “manually” generate access tokens by selecting the All Applications button. image004

5. Select the Allow button – this authorises that application (in this case your own) to access the Tradevine account data of the currently logged on Tradevine account (in this case your own account). image005

6. Make a note of the access token and access token secret. This data (along with your consumer key and consumer secret) are necessary to make authorised calls to our OAuth API. image006

7. Right let’s test these keys by making an API call. Our API help site contains a sample application which shows how to do this. It also contains C# definitions of our messages and lookup constants so can prove quite useful. You download it at: https://api.tradevine.com/Help/sample/LTI.API.Sample.zip

8. The client sample has already been compiled and you can run it in its current form without any programming tools or knowledge. Open the bin folder under LTI.API.Client. The only file you need to change is the config file LTI.API.Client.exe.config. In here you need to put the consumer key and secret as well as the access token and secret you generated. image007

9. You now run LTI.API.Client from a command window. Running it without any arguments will present the valid arguments for you to use. image008

10. Running this with the /GetAllProducts switch will return all products in your account. image009

11. If you wish to change the sample, debug it etc. you’ll need Visual Studio. A free version can be downloaded here: https://visualstudio.microsoft.com/free-developer-offers/. You can then open the LTI.API.Sample.sln solution file and use the client console application or reference the LTI.API.Model dll library that contains an OAuth client wrapper as well as our message classes and lookup constants. image010