# PHP curl call from localhost return UNAUTHENTICATED\_API\_CALL

**URL:** <https://community.rapyd.net/t/php-curl-call-from-localhost-return-unauthenticated-api-call/21827>\
**Category:** ⚙️ API\
**Created:** [July 12, 2022, 2:28pm UTC](https://community.rapyd.net/t/php-curl-call-from-localhost-return-unauthenticated-api-call/21827 "2022-07-12T14:28:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![manoj](https://sea2.discourse-cdn.com/flex016/user_avatar/community.rapyd.net/manoj/32/8957_2.png) [@manoj](https://community.rapyd.net/u/manoj)\
**Post date:** [July 12, 2022, 2:28pm UTC](https://community.rapyd.net/t/php-curl-call-from-localhost-return-unauthenticated-api-call/21827/1 "2022-07-12T14:28:28Z")

</div>

Hi, I’m trying to call PHP Curl on `https://sandboxapi.rapyd.net/v1/data/countries` from my localhost setup and it results in

```auto
{"status":{"error_code":"UNAUTHENTICATED_API_CALL","status":"ERROR","message":"The API received a request, but the signature did not match. The request was rejected. Corrective action: (1) Remove all whitespace that is not inside a string. (2) Remove trailing zeroes and decimal points, or wrap numbers in a string.","response_code":"UNAUTHENTICATED_API_CALL","operation_id":"c32c567d-691d-41df-81ac-b05f4e0b2eaa"}}

```

I have activated sandbox and using correct credentials, but this still getting this response.  
I think it related to SSL, because it works on live server.

Thanks

---

<div class="post-metadata">

**Author:** ![Community\_Team](https://avatars.discourse-cdn.com/v4/letter/c/46a35a/32.png) [@Community\_Team](https://community.rapyd.net/u/Community_Team)\
**Post date:** [July 12, 2022, 2:52pm UTC](https://community.rapyd.net/t/php-curl-call-from-localhost-return-unauthenticated-api-call/21827/2 "2022-07-12T14:52:23Z")

</div>

Thanks @manoj, I know for when you use localhost for certain complete, cancel and error urls in the parameters, you will have to use [ngrok](https://ngrok.com/).

[https://community.rapyd.net/t/complete-cancel-and-error-urls](https://community.rapyd.net/t/complete-cancel-and-error-urls)

However this may be an issue due to the signature request.

From the error response, this may be due to a couple things:

1. All spaces and other whitespace outside of strings must be removed.
2. Numbers should be sent in strings, not as integers/numbers.

Here are some resources that may help:

- [Rapyd API Request Signatures and How to Calculate](https://community.rapyd.net/t/rapyd-api-request-signatures-and-how-to-calculate/1256)
- [Verify Webhook Signature? - #2 by Minh\_Nguy\_n\_Van](https://community.rapyd.net/t/verify-webhook-signature/1383/2)
- [How to verify Webhook Signature with PHP script](https://community.rapyd.net/t/how-to-verify-webhook-signature-with-php-script/1382)
- [Rapyd Integrations: How to Integrate Checkout into your Online Shopping Cart using Python - YouTube](https://youtu.be/yL5TK4JfP7s)

I would also take a look around your body and and how it may not be parsed correctly.
