question

dacoma avatar image
dacoma asked james-cha Deactivated commented

REST notification, 401 Unauthorized

I am trying to send a notification from a Windows app to an Android app running on the terminal, using the REST API. I have loaded the apk into sandbox, and installed (and re-installed several times) on the terminal.

I am using an API token generated from the merchant's Web Dashboard setup app. The token works for other API calls (such as retrieving orders), but will only return 401 Unauthorized for notifications.

I have seen other posts that mention an "app-scoped" token - does this exist, is it what I need, and is it possible to generate on the Dashboard?

Thanks.

OAuth
4 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.

james-cha avatar image james-cha commented ·

Are you hitting this endpoint? POST /v3/apps/{aId}/merchants/{mId}/notifications

0 Likes 0 ·
dacoma avatar image dacoma commented ·

Yes, I've actually tried both of the following (against the sandbox at https://apisandbox.dev.clover.com) , with the same result:

POST /v3/apps/{aId}/merchants/{mId}/notifications POST /v3/apps/{aId}/devices/{dId}/notifications

RESULT: {"message":"401 Unauthorized"}

0 Likes 0 ·
dacoma avatar image dacoma commented ·

I have also tried another endpoint under "apps", and also got 401 Unauthorized (I believe it was GET /v3/apps/{aId}/merchants/{mId}/billing_info)

However, as stated, the endpoints under "merchants" seem to work, leading me to believe that I might need a different kind of token to work with app-rooted endpoints.

0 Likes 0 ·
sophia avatar image sophia commented ·

Hi,

At this time it is not possible to launch a native application on a Clover device via the semi-integrated SDKs. It is similarly not possible to control a native application on a Clover device via the semi-integrated SDKs.

0 Likes 0 ·

1 Answer

sophia avatar image
sophia answered dacoma commented

Hi,

I'm a little confused by the set up, it would be great if you could help me understand your goals and then we'll do our best to help you meet them.

First, some clarifications: 1. By "REST API," do you mean the REST API for the windows SDK? or do you mean these: https://www.clover.com/api_docs? 2. You said "I am trying to send a notification from a Windows app to an Android app running on the terminal." What are the respective windows and android apps? What is their purpose, their function? And how do they work together?

It is very possible that this is not a semi-integration question. The remote pay SDKs were meant for tethering a Mini to a POS, but that doesn't seem to be your use case here?

1 comment
10 |2000

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

dacoma avatar image dacoma commented ·

Hi, I'll try to explain. We are integrating a Windows POS with a Clover Mini, using remote-pay-windows. This is working fine.

But we also need stand-alone signature capture, for signing contracts, which is not provided by Clover, so we need to implement a custom activity for this, and launch the activity with a notification from POS.

We are trying to use the REST API at the URL you provided, along with an implementation of AppNotificationReceiver on the terminal, but can't get past the 401 error.

Is it possible to launch a custom activity with a notification coming from a 3rd-party system?

0 Likes 0 ·

Welcome to the
Clover Developer Community