question

eli avatar image
eli asked Yasin Shuman commented

401 when trying to send notificaitons

Hello,

I'm working on a clover android app (app id EN4M3FACD8TK8) and would like to send it a notification, but I am encountering a problem. I could not find a solution in the forums.

We have a developer kit and a test device. Our app is installed on the test device and I'm trying to send it a notification. I'm sending the following request.

curl -v -sS -X POST "https://apisandbox.dev.clover.com/v3/apps/EN4M3FACD8TK8/merchants/T1XS1BR3YN68P/notifications" --header "Authorization:Bearer ************" --header "Content-Type:application/json" --data '{"data": 'test'}'

*   Trying 107.155.123.25...
* Connected to apisandbox.dev.clover.com (107.155.123.25) port 443 (#0)
* found 173 certificates in /etc/ssl/certs/ca-certificates.crt
* found 699 certificates in /etc/ssl/certs
* ALPN, offering http/1.1
* SSL connection using TLS1.2 / ECDHE_RSA_AES_256_GCM_SHA384
*      server certificate verification OK
*      server certificate status verification SKIPPED
*      common name: *.dev.clover.com (matched)
*      server certificate expiration date OK
*      server certificate activation date OK
*      certificate public key: RSA
*      certificate version: #3
*      subject: OU=Domain Control Validated,CN=*.dev.clover.com
*      start date: Mon, 16 Feb 2015 02:24:31 GMT
*      expire date: Tue, 17 Apr 2018 19:28:37 GMT
*      issuer: C=BE,O=GlobalSign nv-sa,CN=AlphaSSL CA - SHA256 - G2
*      compression: NULL
* ALPN, server did not agree to a protocol
> POST /v3/apps/EN4M3FACD8TK8/merchants/T1XS1BR3YN68P/notifications HTTP/1.1
> Host: apisandbox.dev.clover.com
> User-Agent: curl/7.47.0
> Accept: */*
> Authorization:Bearer ************
> Content-Type:application/json
> Content-Length: 14
> 
* upload completely sent off: 14 out of 14 bytes
< HTTP/1.1 401 Unauthorized
< content-length: 30
< content-type: application/json; charset=utf-8
< X-Frame-Options: SAMEORIGIN
<
* Connection #0 to host apisandbox.dev.clover.com left intact
{"message":"401 Unauthorized"}

I am using the same bearer token on other endpoints successfully, so it is weird that for notifications it's returning an unauthorized.

Thanks.

Developer Id S4N58QFFQWHTW

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

james-cha avatar image
james-cha Deactivated answered Yasin Shuman commented

Please use the app secret instead of your token.

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.

Yasin Shuman avatar image Yasin Shuman commented ·

@Clover Please update the documentation to reflect this. https://www.clover.com/apidocs#resourceapps

0 Likes 0 ·

Welcome to the
Clover Developer Community