28 lines
702 B
Bash
28 lines
702 B
Bash
|
|
# curl version which is working now
|
|
bopit() {
|
|
URL='https://api.kroger.com/v1'
|
|
CID=$(pass dev/kroger/client_id)
|
|
SID=$(pass dev/kroger/secret)
|
|
TOKEN=$(echo -n "${CID}:${SID}" | base64)
|
|
curl -X POST 'https://api.kroger.com/v1/connect/oauth2/token' \
|
|
--verbose \
|
|
-H 'Content-Type: application/x-www-form-urlencoded' \
|
|
-u "${CID}:${SID}" \
|
|
-d 'grant_type=client_credentials' \
|
|
-d 'scope=product.compact'
|
|
}
|
|
|
|
|
|
test_call() {
|
|
PID='0001111040119'
|
|
curl -X GET \
|
|
"https://api.kroger.com/v1/products/${PID}" \
|
|
-H 'Accept: application/json' \
|
|
-H 'Authorization: Bearer ${TOKEN}'
|
|
}
|
|
|
|
|
|
|
|
KROGER_CLIENT_ID=$(pass dev/kroger/client_id) KROGER_SECRET=$(pass dev/kroger/secret) bun run src
|