25 lines
616 B
Bash
Executable File
25 lines
616 B
Bash
Executable File
#!/bin/bash
|
|
# Query: pdfLayout - Get single PDF layout by ID
|
|
|
|
if [ -z "$1" ]; then
|
|
echo "Usage: $0 <layout_id>"
|
|
echo "Example: $0 1"
|
|
exit 1
|
|
fi
|
|
|
|
LAYOUT_ID="$1"
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
source "${SCRIPT_DIR}/../apikey"
|
|
|
|
curl -s -X POST "https://graphql.ordrestyring.dk/graphql" \
|
|
-H "Content-Type: application/json" \
|
|
-H "Authorization: Bearer ${API_KEY}" \
|
|
--data-binary @- <<EOF | jq '.'
|
|
{
|
|
"query": "query GetPdfLayout(\$id: Int!) { pdfLayout(id: \$id) { id name cutProductNumber cutProductNumberAmount language } }",
|
|
"variables": {
|
|
"id": ${LAYOUT_ID}
|
|
}
|
|
}
|
|
EOF
|