Skip to content

TiendaNube/tiendanube-java-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tiendanube-java-sdk

Small Java SDK to use with the Tienda Nube API.

Download

Latest version

Useful links

Documentation

The main point of entry is the Api class. This class offers an interface to interact with the Tienda Nube API. The methods of this class let you send requests to the API, using list (and nextPage), get, store, create, update, or delete. An instance of Api applies only to one set of ApiCredentials, which is specified when creating the object.

To obtain the ApiCredentials for a store, you may use the obtain class method of ApiCredentials, which requires the OAuth 2 authorization code shown in the official Tienda Nube API documentation as well as your app ID and secret. The ApiCredentials returned should be stored somewhere, in order to be able to reuse them later.

The Tienda Nube API offers several endpoints, which are equivalent to different entities. When accessing the API through the SDK, you must specify which endpoint you want to use when using any of the methods. Many of those (in particular, the creation / modification endpoints of the API) receive certain arguments in JSON format. To be able to send them, you must create a JSONObject which represents the arguments to be sent with the request. This object is part of the json.org SDK for JSON handling, which is included with the SDK for convenience purposes. The information returned is also inside a JSONObject which you must access according to the documentation of the Tienda Nube API of the endpoint you are using.

The examples are a good starting point for working with the SDK. The first one features the creation, modification and deletion of a Script resource. The second one lists all the products in a store. There is also a third one that shows how to obtain ApiCredentials for the first time.

TODO

  • Entities for each particular object type