跳到主要内容

Phone

Definition

phone.json
{
"id": 0,
"userID": 0,
"phoneNumber": "",
"phoneVerifiedAt": "",
"status": 0,
"createdAt": "",
"updatedAt": "",
}

Get Phones

#!/bin/bash

set -e

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

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

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

Get Phone

#!/bin/bash

set -e

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

_id=0

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

Apply Phone.ID

#!/bin/bash

set -e

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

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

Create Phone

#!/bin/bash

set -e

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

curl -X POST "${baseUrl}/phone/" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d @phone.json
信息
phone.json
{
"userID": 0,
"phoneNumber": "",
"phoneVerifiedAt": "",
"status": 0,
}
提示

success status: 201

Update Phone

#!/bin/bash

set -e

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

_id=0

curl -X PUT "${baseUrl}/phone/${_id}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d @phone.json
信息
phone.json
{
"userID": 0,
"phoneNumber": "",
"phoneVerifiedAt": "",
"status": 0,
}

Patch Phone

#!/bin/bash

set -e

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

_id=0

curl -X PATCH "${baseUrl}/phone/${_id}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Attrs: userID,phoneNumber,phoneVerifiedAt,status" \
-d @phone.json
信息
phone.json
{
"userID": 0,
"phoneNumber": "",
"phoneVerifiedAt": "",
"status": 0,
}

Update Phone Status

#!/bin/bash

set -e

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

_id=0

curl -X PATCH "${baseUrl}/phone/${_id}/status/" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d @phone.json
信息
phone.json
{
"status": 0
}

Destroy Phone

#!/bin/bash

set -e

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

_id=0

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