I’m trying to get the example cURL from the documentation to work from within VBA
I have extrapolated it to the payload:
varGraphQL = "{""query"": ""query { shopifyqlQuery(query: ""FROM orders SHOW sum(net_sales) AS monthly_net_sales GROUP BY month SINCE -3m ORDER BY month"") { __typename ... on TableResponse { tableData { unformattedData rowData columns { name dataType displayName } } } parseErrors { code message range { start { line character } end { line character } } } } }""}"
and I get the result:
{"errors":"Not Found"}
My end intention is to product a script that will extract the stock movement from the day before. Any help with this would be greatly appreciated
dim putURL as string ' - retrieved from else-where
dim APItoken as string ' - retrieved from else-where
dim APImethod as string
dim putAPItext as string
APImethod = "POST"
putAPItext = "{""query"": ""query { shopifyqlQuery(query: ""FROM orders SHOW sum(net_sales) AS monthly_net_sales GROUP BY month SINCE -3m ORDER BY month"") { __typename ... on TableResponse { tableData { unformattedData rowData columns { name dataType displayName } } } parseErrors { code message range { start { line character } end { line character } } } } }""}"
Dim PutReQuest As MSXML2.XMLHTTP60 ' Not allowed to use serverXML
Set PutReQuest = New XMLHTTP60
With PutReQuest
.Open APImethod, putURL, False
.setRequestHeader "Accept", "text/json"
.setRequestHeader "Content-Type", "application/json;charset=UTF-8"
.setRequestHeader "X-Shopify-Access-Token", APItoken
.setRequestHeader "X-GraphQL-Cost-Include-Fields", "true"
.send (putAPItext)
ShopifyAPIresult = .responseText
.abort
End With