Let's say I need to perform complex SOQL Query and there is unable to use GET with queryParams. Is it possible to use POST with query script inside the body? If so could anybody provide a simple example?


Yes, you can use the composite request API.

The URL for this is /services/data/v50.0/composite.

Example Payload

  "compositeRequest": [{
    "method": "GET",
    "url": "/services/data/v50.0/query?q=select+id+from+account",
    "referenceId": "query1"

You can also use this to bundle multiple queries in to a single request, as well as other operations, like DML or describe calls.

Feel free to read more in the documentation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.