25 lines
650 B
Bash
Executable File
25 lines
650 B
Bash
Executable File
#!/bin/bash
|
|
# Query: userDocuments - Get user documents list
|
|
|
|
if [ -z "$1" ]; then
|
|
echo "Usage: $0 <user_id>"
|
|
echo "Example: $0 123"
|
|
exit 1
|
|
fi
|
|
|
|
USER_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 GetUserDocuments(\$userId: Int!) { userDocuments(userId: \$userId, pagination: { limit: 10 }) { items { id filename description createdAt } } }",
|
|
"variables": {
|
|
"userId": ${USER_ID}
|
|
}
|
|
}
|
|
EOF
|