I am trying to use the Shopify GraphQL Admin API from Delphi. Came up with the following code:
procedure TestShopify;
var
Client: TRESTClient;
Request: TRESTRequest;
Response: TRESTResponse;
QueryJSON: string;
begin
Client := TRESTClient.Create('https://<my shop>.myshopify.com/admin/api/2025-10/graphql.json');
Request := TRESTRequest.Create(nil);
Response := TRESTResponse.Create(nil);
try
Request.Client := Client;
Request.Response := Response;
Request.Method := rmPOST;
Request.Params.Clear;
Request.AddParameter('X-Shopify-Access-Token', '<app token from shopify>', pkHTTPHEADER);
Request.AddParameter('Accept', 'application/json', pkHTTPHEADER);
Request.AddParameter('Content-Type', 'application/json', pkHTTPHEADER);
QueryJSON := '{"query": "{ shop { name myshopifyDomain } }"}';
Request.Body.ClearBody;
Request.AddBody(QueryJSON, ctNone);
Request.Execute;
finally
Response.Free;
Request.Free;
Client.Free;
end;
end;
Did try "different flavours" of the above code and the best I got was this error:
Project TestShopify.exe raised exception class EHTTPProtocolException with message 'HTTP/1.1 406 Not Acceptable'.
Note: I did try the above request with Postman from my computer and I get back the expected result.
{"query": "{ shop { name myshopifyDomain } }"}is invalid JSON all along, it must be at leastname: "myDomain". Sure you posted exactly the same with Postman?ctNONEyou might want to passctAPPLICATION_JSON.Important: To access REST APIs using the HTTPS protocol, you should download OpenSSL libraries provided by the Indy project.So you will have to use Indy based rest client to work over HTTPS protocol.