question

corey avatar image
corey asked Miguel Deactivated commented

Doing a GET Request for Categories

Hello,

I wanted to know the proper format for doing a GET Request when creating a webapp. I am trying:

and it is not making the request. Can someone tell me what I am doing wrong or what the correct format is?

Thanks.

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

Miguel avatar image
Miguel Deactivated answered Miguel Deactivated commented

Hi Corey,

I don't see the request you're attempting, but here's an example of a GET request for retrieving all categories from a merchant in your sandbox account:

https://apisandbox.dev.clover.com/v3/merchants/{mId}/categories

Make sure to replace {mId} with the correct merchant ID. You can find more info in our Docs here: https://sandbox.dev.clover.com/api_do...

Thanks, Miguel

6 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.

corey avatar image corey commented ·

HI Miguel. I'm trying to have the webapp take the merchant ID from the merchant account that installs and runs the app. How would I retrieve the Merchant ID to complete the GET Request?

0 Likes 0 ·
Miguel avatar image Miguel commented ·

You should be able to get the merchant ID as a query parameter when your web app is launched by the merchant from the Clover dashboard.

0 Likes 0 ·
corey avatar image corey commented ·

By using this format? https://apisandbox.dev.clover.com/v3/...

I'm confused as to how I should code it?

0 Likes 0 ·
Miguel avatar image Miguel commented ·

In the actual request, there shouldn't be curly brackets. For example, if the merchant ID was 1234, the request would look like the following:

https://apisandbox.dev.clover.com/v3/merchants/1234/categories

Also, I would recommend reviewing the documentation for building web apps and sample code: https://docs.clover.com/build/web-apps/
https://github.com/clover

0 Likes 0 ·
corey avatar image corey commented ·

Ok, but the issue I am running into is what happens when an end user from a different store installs the app?

If merchant 4321 open the app from the dashboard the get request will try to pull for merchant 1234.

0 Likes 0 ·
Show more comments

Welcome to the
Clover Developer Community