Files
tilbudgivern/apitest/examples/curl_notification.sh

25 lines
624 B
Bash
Executable File

#!/bin/bash
# Query: notification - Get single notification
if [ -z "$1" ]; then
echo "Usage: $0 <notification_id>"
echo "Example: $0 abc123"
exit 1
fi
NOTIFICATION_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 GetNotification(\$id: String!) { notification(id: \$id) { id title message createdAt read } }",
"variables": {
"id": "${NOTIFICATION_ID}"
}
}
EOF