So that we can better help you with your question, would it be possible for you to share the printout of your request and the response?
Something I noticed too, you are passing quotes in the pipe and phase ID parameters. We don't support quotes in number fields, only in string.
Regards Felipe
Hi @felipealves
The apostrophes are there because $pipe_id and $phase_id are variables. There are no apostrophes carried out to the actual request.
Here is a screenshot of the complete code I’m using so far:
You will find the Guzzle request debug file attached to this message (debug.txt).
The result of the request are as follows:
Thanks for your help!
Enrique
@felipealves can you help us on it, please?
@Lais Laudari. Sure, I can help.
@enrique.herbella, thank you for the information you sent, I'll take a look and get back to you as soon as I finish my analysis.
Hello @enrique.herbella,
Sorry for the delay, analyzing the code you sent me. It seems to be because the pipe_id and phase_id are getting quotes, and because it is a number in GraphQL it needs to be unquoted, if it was a string then we would need to include quotes in it.
Could you make this adjustment and validate it on your side?
Hi @felipealves Unfortunatly I have made the change you have suggested but I’m still getting the same error.
Could you please provide me with a working example of a createCard request? Thanks!
Enrique
Hi @enrique.herbella
It might be related to some issues with the pipe structure, some mandatory fields you do not supply in your request, or the phase not being set up with a phase form.
The following PHP code works perfectly fine in my test-pipe – feel free to use it as a basis, and try to experiment with what fields might be the reason for the issue you are seeing:
<?php
require_once("vendor/autoload.php"); use GraphQL\Client;
If I adjust it to submit a non-existant field, I get a `Fields not found` error. When I do not submit a mandatory field I get a `Invalid inputs` error.
Generally, it would be interesting to see the actual response you get, not just that it is a 400 error. You can wrap your `->request()` in try/catch, and use `->getResponse()` on the exception you catch, I guess.
Hi @genietim
I have made more trials but unfortunatly I am not getting to get any other result than 400 bad request.
I have tried to print ->getResponse() but it does not produce useful information.
The pipe I am using has no fields configured. It has 3 phases however. Here is my updated code. The result is attached to this message. Thank you for any help you can provide.
Enrique
Well, dear @enrique.herbella , without any fields configured, particularly not a field with ID “email” and ID “title”, at least your initial query will fail for sure.
Would you mind trying with my code above (which uses https://github.com/mghoneimy/php-graphql-client, which also uses GuzzleHTTP), replacing the pipe id with yours, just to eliminate the possibility that you have a typo or invalid API key or similar that I oversee? Also, I never go so unhelpful error messages using this library as the one you present, so maybe it could also help in that regard.
Are you familiar with Postman (https://www.postman.com/downloads/), @enrique.herbella ? It really helps to use it, just to see whether the code is the problem or the query/authentication. Also, it can readily output PHP code for you, including code that uses Guzzle.
After investing another 30 minutes trying to figure out what could be going wrong, I noticed that I can reproduce your error using explicitly your most recent query.
The reason are various typos in it, that I noticed now: you neighter close the “ opened for the mutation, nor the { opened before the query.
Actually, your query should therefore look something like this: