question

bntssoft avatar image
bntssoft asked teamxna commented

SandBox Rest API Details

Hi,

Where can we get the complete rest API reference document for sandbox environment? Also, how to generate the access token for the sandbox account using clover android sdk?

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Jacob Abrams avatar image
Jacob Abrams answered teamxna commented

The sandbox API is identical to production API. The sandbox is simply a different server environment to be used by 3rd party developers. The web REST API has the following documentation:

Guide: https://docs.clover.com/build/web-app... V3 API: https://www.clover.com/api_docs V2 API: https://www.clover.com/rest-api#

If you want to use the web REST API from an android app on a Clover device please read this: https://docs.clover.com/build/android...

The clover-android-sdk should hopefully provide you with all the functionality you need such that it isn't necessary to use the web REST API from a Clover android app. The clover-android-sdk is preferable because it works offline, ensures other apps on the system see changes sooner and should be faster and more reliable than making your own network calls.

8 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

bntssoft avatar image bntssoft commented ·

Hi, these seems to be the production REST API guide.. We are looking for the sandbox specific complete REST API guide.. as mentioned in "http://devask.clover.com/question/13/what-is-the-root-url-for-the-sandbox-rest-api/" Where can we get the details of all the APIs for sandbox( Sandbox Rest API console) like production REST API console

0 Likes 0 ·
Jacob Abrams avatar image Jacob Abrams ♦♦ commented ·

The sandbox API is identical the production API. Simply replace the production URL www.clover.com with sandbox.dev.clover.com or api.clover.com with apisandbox.dev.clover.com. The sandbox is a development environment that operates separate from but nearly identical to production. You can read more about the theory of development environments here: https://en.wikipedia.org/wiki/Deploym...

0 Likes 0 ·
bntssoft avatar image bntssoft commented ·

Hi, Thanks for the quick response. We are creating the access token using clover android sdk. when we are trying to call the Sandbox API using the access token, we are getting "401:unautorized response " from the Sandbox APIs. Is there any other provision to create access token specific for sandbox account using clover android SDK which will give authorized response?

0 Likes 0 ·
Jacob Abrams avatar image Jacob Abrams ♦♦ commented ·

It's unclear to me what you mean by "we are creating the access token using clover android sdk". How are you doing that? Are you building an android application that runs on a Clover device or runs somewhere else? The clover android sdk helps developers create android apps that runs on Clover devices it won't help you create an access token if you are building an app that runs on your servers or on other devices. To setup access for an app that is not running on a Clover device you will likely need to use OAUTH: https://docs.clover.com/build/web-app...

0 Likes 0 ·
bntssoft avatar image bntssoft commented ·

Yes, we have developed an android application and calling Clover Rest APIs to fetch the clover data into our android application invoking our server. Using below URL, we are generation the authToken for the merchant and using that token , we are calling all clover Rest APIs via our server. https://github.com/clover/android-exa... So, now the token generated by above code is not allowing us to call any sandbox APIs.(401: unauthorized) Is there any other way out so that we can create token for sandbox ?

0 Likes 0 ·
Show more comments

Welcome to the
Clover Developer Community