question

kharv avatar image
kharv asked ·

OAuth 2.0 API Token Request - 204 'No Content Found'

Hi,
I'm currently trying obtain a testing API token for my test merchant. I've been following the documentation in the links below. The documentation for the Clover OAuth 2.0 Flow states that I should first request merchant authorization and then use the authorization code to request the API Token from the Clover Servers.

I tried performing the following request:

curl --request GET \
--url 'https://apisandbox.dev.clover.com/oauth/authorize?client_id={id}' \
--header 'Content-Type: application/json'


I'm receiving response, ' 204 No Content`.

I'm unable to figure out why I'm receiving this response. Would someone be able to point me in the right direction?

Documentation Links:
- Create A Test API Token: https://docs.clover.com/build/merchant-id-and-api-...
- Getting Started with the Clover REST API using Postman: https://medium.com/clover-platform-blog/four-minu...

SandboxMerchantAPI TokenOAuth
2 comments
10 |2000 characters needed characters left characters exceeded

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

@kharv Can you help me to make it working? Below is my code in webhook callback url file but I am not getting auth code
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://sandbox.dev.clover.com/oauth/authorize?client_id=ClientID');
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_HEADER, 0);
$result = curl_exec($ch);
$response = curl_getinfo($ch);
curl_close($ch); 
$fp = fopen($file, "a");
fwrite($fp, $result);
fwrite($fp, "\n\n");
fclose($fp);
$result gives 1 as output. Please help.
0 Likes 0 · ·
Hi @Arvi,
I apologize for the delay. Your issue seems to be slightly different than my original question. I recommend posting a new question to the community.
0 Likes 0 · ·

1 Answer

keithryanwong avatar image
keithryanwong answered ·

Hi @kharv,

The url should just be sandbox.dev.clover.com, not apisandbox.dev.clover.com

Please note the difference in the docs: https://docs.clover.com/build/oauth-2-0/

Best,

Keith

1 comment Share
10 |2000 characters needed characters left characters exceeded

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

Thanks, @keithryanwong! That worked. I appreciate the help!

1 Like 1 · ·

Welcome to the
Clover Developer Community