Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API error The response has unexpected status code (0) #248

Open
jcpicot04 opened this issue Apr 26, 2021 · 4 comments
Open

API error The response has unexpected status code (0) #248

jcpicot04 opened this issue Apr 26, 2021 · 4 comments

Comments

@jcpicot04
Copy link

jcpicot04 commented Apr 26, 2021

Hi! I’m trying to connect with the API using Basic Auth but I’m getting an error 0.
It’s not a caché problem, i’m deleting the caché frequently.
The full response it’s:

array(1) { [“errors”]=> array(1) { [0]=> array(2) { [“code”]=> int(0) [“message”]=> string(56) "The response has unexpected status code (0). Response: " } } }

That’s my code:
Captura

And all good in the config:
Captura2

Thanks!

UPDATE:
The code return the same error in post/update but works!

It’s not working only for GET method, only returns the 0 error.

Any help? Thanks!


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@kovkor
Copy link

kovkor commented Jun 2, 2021

Hi,

Same error in here with the basic Contacts API get method.
Any suggestions or tips with this issue?

Thank you!

@kovkor
Copy link

kovkor commented Jun 2, 2021

In the meantime I figured out the problem. Is not Mautic specific but my local development environment.
I run Mautic with Mamp and I tried to connect to the API endpoints from Docker container.

@jcpicot04 try to debug the Curl error message from here: lib/Auth/AbstractAuth.php, line 178 and you can see the error message.

@faisalsarfraz
Copy link

Does anybody got its solution? Referring to @kovkor response, can you please expain as that file is not in Mautic 3.3.3 version

@kovkor
Copy link

kovkor commented Aug 17, 2021

@faisalsarfraz

In my case I put this line temporarily into the file lib/Auth/AbstractAuth.php, line 178
echo 'Curl error: ' . curl_error($curl);

The error message was:
Curl error: Could not resolve host: xxxx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants