No Query String Present - Salesforce Apex Callout

Hi Folks,

I’m trying to connect to the api from Salesforce.

I get an initial OK - 200 when authenticating but then receive: {“errors”:[{“message”:“No query string was present”}],“account_id”:2027725} in the response body.

If I run the method

req.SetHeader('Content-Type', 'application/json');

I can’t even authenticate.

Any ideas? See code below.

public class mondayAPI{

public static httpResponse callout(){

    String apiKey = 'my api key' here;

    String query = '{ "query" : "{boards(ids: 813785147)}}" ';

    //instantiate httpRequest

    HttpRequest req = new HttpRequest();

    //set http method and endoint for request instance



    //set body and header

    req.setHeader('Authorization', apiKey);


    //instantiate the http

    http h = new http();

    //make the call out using the http.send() method

    HttpResponse res = h.send(req);

    Integer statusCode = res.getStatusCode();

    String status = res.getStatus();

    String body = res.getBody();


    System.debug('Request Body: ' + req.getBody());




    return res;



Hey @SiriDeva - welcome to the community!

That error suggests to me that the call is being made to the monday API, and it is being verified against the account. However it cannot find a query string. Could we try have the query string as one whole uninterrupted line item?

String query = '{query : {boards(ids: 813785147)}} ';


Thanks for your response @dsilva.

I tried as you suggested and received the same error.

I’ve pasted the log below.

Appreciate your help!

I figured this out.

I had two errors.

The graphQL within my JSON request body was malformed.

correct is: String query = '{ "query" : "{boards(ids:413622857){id}}" }';

The content-type header needs to be set to json:

req.setHeader('Content-Type', 'application/json');