I'm trying to set up an automatic order import through the API so I can import Shapeways orders into a financial dashboard app. I'm using PHP, Guzzle, and OAuth2Middleware to connect to the API:
$reauthClient = new Client([
'base_uri' => '
https://api.shapeways.com/oauth2/token'
]);
$reauthConfig = [
'client_id' => config('services.shapeways.client_id'),
'client_secret' => config('services.shapeways.client_secret'),
];
$oauth = new OAuth2Middleware(new ClientCredentials($reauthClient, $reauthConfig));
$stack = HandlerStack::create();
$stack->push($oauth);
$client = new Client([
'auth' => 'oauth',
'handler' => $stack
]);
$response = json_decode($client->get('
https://api.shapeways.com/orders/v1')->getBody()->getContents());
This successfully connects to the API without any authentication errors, however, in the response I get back, `orderinfo` is null, and my order counts are all zero:
{#2845
+"result": "success"
+"ordersCount": {#2857
+"total": 0
+"placed": 0
+"in_production": 0
+"cancelled": 0
+"unknown": 0
+"shipped": 0
}
+"ordersStatus": []
+"ordersInfo": null
+"nextActionSuggestions": {#2851
+"url": "offset=20"
}
}
If I try to access an order I
know exists, like so:
Then I receive a 400 bad request response:
{"result":"failure","reason":"No orders found for your app with orderId [3386368]"}
Any ideas? Why can't my app see my orders?