I am getting errors running graphql query via curl in php. here is my code
$endpoint = “https://public-api.shiphero.com/graphql”;
$status = “pending”;
$dt_from = date(“Y-m-d”) . " 00:00:00";
$dt_to = date(“Y-m-d”) . “23:59:00”;
$query = <<<GraphQL
“query” :"query {\n\r
orders (fulfillment_status:“pending”, order_date_from: “2020-11-17 00:00:00”, order_date_to: “2020-11-17 23:59:59”) {
request_id
data {
edges {
node {
id
legacy_id
order_number
fulfillment_status
order_date
required_ship_date
subtotal
total_discounts
total_price
shipments {
id
warehouse_id
address {
name
address1
address2
city
state
country
zip
phone
}
}
}
}
}
}
"
GraphQL;
$headers = array();
$headers[] = ‘Content-Type: application/json’;
$headers[] = 'Authorization: Bearer '.$authToken;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $endpoint);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);
curl_setopt($ch, CURLOPT_POSTFIELDS, $query);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
$result = curl_exec($ch);
and the response I get is
{“message”: “Unexpected error. Please contact a system administrator.”}