question

SAMSA Web Team avatar image
SAMSA Web Team asked David Marginian answered

Error sending alert to device. Details: status returned was not 200

Hi,

We are trying to test our production credentials for our app with our Clover Minis. We've in the past had an issue with CORS and had gotten updated permissions on the app to help with that. However, when we went to do testing today, we are now getting an error stating: Error sending alert to device. Details: status returned was not 200. There is an error code of "NotConnected" and an error type of "COMMUNICATION".

We did not have this problem before and are not having this problem with our sandbox account or mini. Our code is exactly the same for both outside of our configuration pointing to our production merchants/account.

Any insight in where to look would be greatly appreciated. We did call to support and talked for about an hour with them about checking connections to the minis as well as internet connection with them but that did not lead anywhere.

Thanks!

-Steve

App Market
10 |2000

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

David Marginian avatar image
David Marginian answered

Issue is resolved, the developer has modified the permissions of the app after the app was installed. Additionally the developer was trying to hit a device that they no longer had and was offline.

10 |2000

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

David Marginian avatar image
David Marginian answered

Generally when this occurs: either 1) Your token isn't valid 2) Your CORs URL is not set correctly on your app or, 3) You have the incorrect Clover URL set in your connection configuration.

10 |2000

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

SAMSA Web Team avatar image
SAMSA Web Team answered David Marginian commented

Thanks, David. Can you please confirm what Clover URL we should be using in live? Sandbox works fine for us. Thanks

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.

SAMSA Web Team avatar image
SAMSA Web Team answered SAMSA Web Team commented

Hi David,

It has been a while due to holidays and other projects but I am getting back into this and trying to get the production environment working. However, I am still having the same issue with getting a 401 unauthorized error. To refresh, the error coming back is "Error sending alert to device. Details: status returned was not 200".

I have checked against the items that you mentioned in your response from October:

1.) Your token isn't valid - This feels like the most likely problem however I am following the OAuth2 flow provided and am successfully getting back an API Token from a request to https://www.clover.com/.. It feels as though if there was something done incorrectly here that we would get an error response back however that isn't the case and we are getting a result here. However, if I attempt to run a call using that API key immediately after receiving it I am still getting at 401 unauthorized response.

2.) Your CORS URL is not set correctly on your app - I have checked and double checked and verified this is set properly. We are no longer getting a CORS related error.

3.) You have the incorrect Clover URL set in your connection configuration - I have double checked this as well and the proper configuration URL from the important section you referenced is being used (https://www.clover.com)


To me it feels as though one of two things is happening - Either we are getting back an API key that isn't valid for some reason or the permission isn't being granted with the key. I'm looking for suggestions on what should be our next step over here to try. For reference, I followed the video provided here for my OAuth confirmation provided by Clover: https://www.youtube.com/watch?v=zScD5jQC6_g

I have also verified that we are using "CODE" vs "TOKEN" for the "Default OAuth Response" when I confirmed the CORS Domain.

Thank you for any insight you can provide!

-Steve

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

In a moderator's only comment provide me with your production app id and production merchant id. Also provide me with the connection configuration you are passing to the sdk (redact token please).
0 Likes 0 ·
David Marginian avatar image David Marginian ♦♦ David Marginian ♦♦ ·

"However, if I attempt to run a call using that API key immediately after receiving it I am still getting at 401 unauthorized response."

What request? Did you change the permissions of your app after it was installed? If so, the app will need to be uninstalled, re-installed and then you will need to obtain a new token. Also, I am seeing the device you are trying to connect to as disconnected, that may be the issue you run into next (once you get the access token working).

0 Likes 0 ·
David Marginian avatar image David Marginian ♦♦ David Marginian ♦♦ ·
Please don't respond to private comments, as if I reply you won't be able to see my comment.

Yes, you should be able to make the read-merchant call. When did you obtain the token? You have two devices, are you sure you are looking at the correct device?

0 Likes 0 ·
David Marginian avatar image David Marginian ♦♦ David Marginian ♦♦ ·
I looked up the tokens for your app and the merchant you provided, they all have insufficient priveleges, meaning the permissions were changed AFTER the app was installed. I am going to uninstall/reinstall your app and then you will need to obtain a new token and you should be good.
0 Likes 0 ·
Show more comments
Show more comments
SAMSA Web Team avatar image
SAMSA Web Team answered SAMSA Web Team commented

David, how can we correct that? Not sure how that might have gotten messed up - are you able to help us with that?

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

You need to determine what device you actually have in front of you. You can determine what the serial number of the device is via the help or diagnostic app. I don't have a device in front of me right now but you should be able to find it if you poke around a bit.
0 Likes 0 ·
David Marginian avatar image David Marginian ♦♦ David Marginian ♦♦ ·

That serial number does not match the device uuid you are passing in. Information on obtaining the device uuid can be found here - https://docs.clover.com/docs/cloud-sdk-v3#option-2-cloud-pay-display.

0 Likes 0 ·
SAMSA Web Team avatar image SAMSA Web Team David Marginian ♦♦ ·
David,


It was that the device id was for the device that was replaced previously. I made the switch and everything looks good on this side. I'll reach out if anything else comes up but sincerely thank you for your help with getting this figured out.


-Steve

0 Likes 0 ·

Welcome to the
Clover Developer Community