Closed charlespwd closed 3 years ago
The following command will return null if the API response returns an error.
curl -s -X GET \ -u $username:$password \ "$host/admin/api/2021-04/products.json?published_status=published&limit=1" \ | jq -r '.products[0].handle'
An error API response would look like this:
{"errors":"[API] This action requires merchant approval for read_products scope."}
We should exit 1 with "jq '.errors'" as message instead.
The following command will return null if the API response returns an error.
An error API response would look like this:
We should exit 1 with "jq '.errors'" as message instead.