25 lines
584 B
Bash
Executable File
25 lines
584 B
Bash
Executable File
#!/bin/bash
|
|
# Query: message - Get single message by ID
|
|
|
|
if [ -z "$1" ]; then
|
|
echo "Usage: $0 <message_id>"
|
|
echo "Example: $0 1"
|
|
exit 1
|
|
fi
|
|
|
|
MESSAGE_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 GetMessage(\$id: Int!) { message(id: \$id) { id subject body createdAt read } }",
|
|
"variables": {
|
|
"id": ${MESSAGE_ID}
|
|
}
|
|
}
|
|
EOF
|