跳到主要内容

Token

Definition

token.json
{
"id": 0,
"userID": 0,
"accessToken": "",
"refreshToken": "",
"scope": "",
"tokenType": "",
"expireAt": "",
"client": "",
"version": "",
"createdAt": "",
"updatedAt": "",
}

Get Tokens

#!/bin/bash

set -e

if [ -f ./_env.bash ] ; then
source ./_env.bash
fi

_filter=""
_orderBy=""
_page=1
_pageSize=10

curl -X GET "${baseUrl}/token/?_filter=${_filter}&_orderBy=${_orderBy}&_page=${_page}&_pageSize=${_pageSize}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"

Get Token

#!/bin/bash

set -e

if [ -f ./_env.bash ] ; then
source ./_env.bash
fi

_id=0

curl -X GET "${baseUrl}/token/${_id}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"

Apply Token.ID

#!/bin/bash

set -e

if [ -f ./_env.bash ] ; then
source ./_env.bash
fi

curl -X POST "${baseUrl}/apply/token/id/" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"

Create Token

#!/bin/bash

set -e

if [ -f ./_env.bash ] ; then
source ./_env.bash
fi

curl -X POST "${baseUrl}/token/" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d @token.json
信息
token.json
{
"userID": 0,
"accessToken": "",
"refreshToken": "",
"scope": "",
"tokenType": "",
"expireAt": "",
}
提示

success status: 201

Update Token

#!/bin/bash

set -e

if [ -f ./_env.bash ] ; then
source ./_env.bash
fi

_id=0

curl -X PUT "${baseUrl}/token/${_id}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d @token.json
信息
token.json
{
"userID": 0,
"accessToken": "",
"refreshToken": "",
"scope": "",
"tokenType": "",
"expireAt": "",
}

Patch Token

#!/bin/bash

set -e

if [ -f ./_env.bash ] ; then
source ./_env.bash
fi

_id=0

curl -X PATCH "${baseUrl}/token/${_id}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Attrs: userID,accessToken,refreshToken,scope,tokenType,expireAt" \
-d @token.json
信息
token.json
{
"userID": 0,
"accessToken": "",
"refreshToken": "",
"scope": "",
"tokenType": "",
"expireAt": "",
}

Destroy Token

#!/bin/bash

set -e

if [ -f ./_env.bash ] ; then
source ./_env.bash
fi

_id=0

curl -X DELETE "${baseUrl}/token/${_id}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"