# Owl Admin API Documentation

MENU

# Introduction

Owl Admin API 接口文档

Base URL: `http://192.168.110.10`

欢迎使用 Owl Admin API 文档。

本文档提供了所有 API 接口的详细信息，包括请求参数、响应格式等。

# Authenticating requests

To authenticate requests, include an `Authorization` header with the value `"Bearer 69|KO7sJGJlD0AxUDOxnKf5uEs4AnvEJKeRQG527cns36375743"`.

All authenticated endpoints are marked with a `requires authentication` badge in the documentation below.

通过登录接口获取 token，格式为 Bearer 69|KO7sJGJlD0AxUDOxnKf5uEs4AnvEJKeRQG527cns36375743{token}

# Endpoints

## 更新API文档的认证Token

requires authentication

通过手机号获取验证码并登录，然后更新API文档的认证Token

> Example request:

    curl --request GET \
        --get "http://192.168.110.10/api/scribe/update-token/13800138000" \
        --header "Authorization: Bearer 69|KO7sJGJlD0AxUDOxnKf5uEs4AnvEJKeRQG527cns36375743"

    const url = new URL(
        "http://192.168.110.10/api/scribe/update-token/13800138000"
    );

    const headers = {
        "Authorization": "Bearer 69|KO7sJGJlD0AxUDOxnKf5uEs4AnvEJKeRQG527cns36375743",
        "Accept": "application/json",
    };

    fetch(url, {
        method: "GET",
        headers,
    }).then(response => response.json());

    $client = new \GuzzleHttp\Client();
    $url = 'http://192.168.110.10/api/scribe/update-token/13800138000';
    $response = $client->get(
        $url,
        [
            'headers' => [
                'Authorization' => 'Bearer 69|KO7sJGJlD0AxUDOxnKf5uEs4AnvEJKeRQG527cns36375743',
            ],
        ]
    );
    $body = $response->getBody();
    print_r(json_decode((string) $body));

> Example response (200):

    {
        "code": 200,
        "message": "Token更新成功",
        "data": {
            "token": "your_new_token_here"
        }
    }

> Received response:

> Request failed with error:

    Tip: Check that you're properly connected to the network.
    If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
    You can check the Dev Tools console for debugging information.

### Request

GET `api/scribe/update-token/{mobile}`

#### Headers

`Authorization`

Example: `Bearer 69|KO7sJGJlD0AxUDOxnKf5uEs4AnvEJKeRQG527cns36375743`

#### URL Parameters

`mobile` string

手机号码. Example: `13800138000`

## [账户管理] 发送验证码

requires authentication

向指定手机号发送验证码

> Example request:

    curl --request POST \
        "http://192.168.110.10/api/account/send-code" \
        --header "Authorization: Bearer 69|KO7sJGJlD0AxUDOxnKf5uEs4AnvEJKeRQG527cns36375743" \
        --header "Content-Type: application/json" \
        --data "{
        \"mobile\": \"13800138000\"
    }"

    const url = new URL(
        "http://192.168.110.10/api/account/send-code"
    );

    const headers = {
        "Authorization": "Bearer 69|KO7sJGJlD0AxUDOxnKf5uEs4AnvEJKeRQG527cns36375743",
        "Content-Type": "application/json",
        "Accept": "application/json",
    };

    let body = {
        "mobile": "13800138000"
    };

    fetch(url, {
        method: "POST",
        headers,
        body: JSON.stringify(body),
    }).then(response => response.json());

    $client = new \GuzzleHttp\Client();
    $url = 'http://192.168.110.10/api/account/send-code';
    $response = $client->post(
        $url,
        [
            'headers' => [
                'Authorization' => 'Bearer 69|KO7sJGJlD0AxUDOxnKf5uEs4AnvEJKeRQG527cns36375743',
                'Content-Type' => 'application/json',
            ],
            'json' => [
                'mobile' => '13800138000',
            ],
        ]
    );
    $body = $response->getBody();
    print_r(json_decode((string) $body));

> Example response (200):

    {
        "code": 200,
        "message": "验证码发送成功",
        "data": null
    }

> Received response:

> Request failed with error:

    Tip: Check that you're properly connected to the network.
    If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
    You can check the Dev Tools console for debugging information.

### Request

POST `api/account/send-code`

#### Headers

`Authorization`

Example: `Bearer 69|KO7sJGJlD0AxUDOxnKf5uEs4AnvEJKeRQG527cns36375743`

`Content-Type`

Example: `application/json`

#### Body Parameters

`mobile` string

手机号码. Example: `13800138000`

## [账户管理] 用户登录

requires authentication

使用手机号和验证码登录账户

> Example request:

    curl --request POST \
        "http://192.168.110.10/api/account/login" \
        --header "Authorization: Bearer 69|KO7sJGJlD0AxUDOxnKf5uEs4AnvEJKeRQG527cns36375743" \
        --header "Content-Type: application/json" \
        --data "{
        \"mobile\": \"13800138000\",
        \"code\": \"123456\"
    }"

    const url = new URL(
        "http://192.168.110.10/api/account/login"
    );

    const headers = {
        "Authorization": "Bearer 69|KO7sJGJlD0AxUDOxnKf5uEs4AnvEJKeRQG527cns36375743",
        "Content-Type": "application/json",
        "Accept": "application/json",
    };

    let body = {
        "mobile": "13800138000",
        "code": "123456"
    };

    fetch(url, {
        method: "POST",
        headers,
        body: JSON.stringify(body),
    }).then(response => response.json());

    $client = new \GuzzleHttp\Client();
    $url = 'http://192.168.110.10/api/account/login';
    $response = $client->post(
        $url,
        [
            'headers' => [
                'Authorization' => 'Bearer 69|KO7sJGJlD0AxUDOxnKf5uEs4AnvEJKeRQG527cns36375743',
                'Content-Type' => 'application/json',
            ],
            'json' => [
                'mobile' => '13800138000',
                'code' => '123456',
            ],
        ]
    );
    $body = $response->getBody();
    print_r(json_decode((string) $body));

> Example response (200):

    {
        "code": 200,
        "message": "登录成功",
        "data": {
            "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...",
            "user": {
                "id": 1,
                "mobile": "13800138000",
                "nickname": "用户昵称"
            }
        }
    }

> Received response:

> Request failed with error:

    Tip: Check that you're properly connected to the network.
    If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
    You can check the Dev Tools console for debugging information.

### Request

POST `api/account/login`

#### Headers

`Authorization`

Example: `Bearer 69|KO7sJGJlD0AxUDOxnKf5uEs4AnvEJKeRQG527cns36375743`

`Content-Type`

Example: `application/json`

#### Body Parameters

`mobile` string

手机号码. Example: `13800138000`

`code` string

验证码. Example: `123456`

## [账户管理] 微信登录

requires authentication

使用微信openid登录账户

> Example request:

    curl --request POST \
        "http://192.168.110.10/api/account/wx-login" \
        --header "Authorization: Bearer 69|KO7sJGJlD0AxUDOxnKf5uEs4AnvEJKeRQG527cns36375743" \
        --header "Content-Type: application/json" \
        --data "{
        \"openid\": \"wx_123456789\"
    }"

    const url = new URL(
        "http://192.168.110.10/api/account/wx-login"
    );

    const headers = {
        "Authorization": "Bearer 69|KO7sJGJlD0AxUDOxnKf5uEs4AnvEJKeRQG527cns36375743",
        "Content-Type": "application/json",
        "Accept": "application/json",
    };

    let body = {
        "openid": "wx_123456789"
    };

    fetch(url, {
        method: "POST",
        headers,
        body: JSON.stringify(body),
    }).then(response => response.json());

    $client = new \GuzzleHttp\Client();
    $url = 'http://192.168.110.10/api/account/wx-login';
    $response = $client->post(
        $url,
        [
            'headers' => [
                'Authorization' => 'Bearer 69|KO7sJGJlD0AxUDOxnKf5uEs4AnvEJKeRQG527cns36375743',
                'Content-Type' => 'application/json',
            ],
            'json' => [
                'openid' => 'wx_123456789',
            ],
        ]
    );
    $body = $response->getBody();
    print_r(json_decode((string) $body));

> Example response (200):

    {
        "code": 200,
        "message": "登录成功",
        "data": {
            "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...",
            "user": {
                "id": 1,
                "openid": "wx_123456789",
                "nickname": "微信昵称"
            }
        }
    }

> Received response:

> Request failed with error:

    Tip: Check that you're properly connected to the network.
    If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
    You can check the Dev Tools console for debugging information.

### Request

POST `api/account/wx-login`

#### Headers

`Authorization`

Example: `Bearer 69|KO7sJGJlD0AxUDOxnKf5uEs4AnvEJKeRQG527cns36375743`

`Content-Type`

Example: `application/json`

#### Body Parameters

`openid` string

微信openid. Example: `wx_123456789`

## [账户管理] 用户退出

requires authentication

退出当前账户登录状态

> Example request:

    curl --request POST \
        "http://192.168.110.10/api/account/logout" \
        --header "Authorization: Bearer 69|KO7sJGJlD0AxUDOxnKf5uEs4AnvEJKeRQG527cns36375743"

    const url = new URL(
        "http://192.168.110.10/api/account/logout"
    );

    const headers = {
        "Authorization": "Bearer 69|KO7sJGJlD0AxUDOxnKf5uEs4AnvEJKeRQG527cns36375743",
        "Accept": "application/json",
    };

    fetch(url, {
        method: "POST",
        headers,
    }).then(response => response.json());

    $client = new \GuzzleHttp\Client();
    $url = 'http://192.168.110.10/api/account/logout';
    $response = $client->post(
        $url,
        [
            'headers' => [
                'Authorization' => 'Bearer 69|KO7sJGJlD0AxUDOxnKf5uEs4AnvEJKeRQG527cns36375743',
            ],
        ]
    );
    $body = $response->getBody();
    print_r(json_decode((string) $body));

> Example response (200):

    {
        "code": 200,
        "message": "退出成功",
        "data": null
    }

> Received response:

> Request failed with error:

    Tip: Check that you're properly connected to the network.
    If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
    You can check the Dev Tools console for debugging information.

### Request

POST `api/account/logout`

#### Headers

`Authorization`

Example: `Bearer 69|KO7sJGJlD0AxUDOxnKf5uEs4AnvEJKeRQG527cns36375743`

## [账户管理] 用户注销

requires authentication

永久注销当前账户

> Example request:

    curl --request DELETE \
        "http://192.168.110.10/api/account" \
        --header "Authorization: Bearer 69|KO7sJGJlD0AxUDOxnKf5uEs4AnvEJKeRQG527cns36375743"

    const url = new URL(
        "http://192.168.110.10/api/account"
    );

    const headers = {
        "Authorization": "Bearer 69|KO7sJGJlD0AxUDOxnKf5uEs4AnvEJKeRQG527cns36375743",
        "Accept": "application/json",
    };

    fetch(url, {
        method: "DELETE",
        headers,
    }).then(response => response.json());

    $client = new \GuzzleHttp\Client();
    $url = 'http://192.168.110.10/api/account';
    $response = $client->delete(
        $url,
        [
            'headers' => [
                'Authorization' => 'Bearer 69|KO7sJGJlD0AxUDOxnKf5uEs4AnvEJKeRQG527cns36375743',
            ],
        ]
    );
    $body = $response->getBody();
    print_r(json_decode((string) $body));

> Example response (200):

    {
        "code": 200,
        "message": "注销成功",
        "data": null
    }

> Received response:

> Request failed with error:

    Tip: Check that you're properly connected to the network.
    If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
    You can check the Dev Tools console for debugging information.

### Request

DELETE `api/account`

#### Headers

`Authorization`

Example: `Bearer 69|KO7sJGJlD0AxUDOxnKf5uEs4AnvEJKeRQG527cns36375743`

## [用户管理] 用户提现

requires authentication

提现用户的余额

> Example request:

    curl --request POST \
        "http://192.168.110.10/api/user/withdraw" \
        --header "Authorization: Bearer 69|KO7sJGJlD0AxUDOxnKf5uEs4AnvEJKeRQG527cns36375743" \
        --header "Content-Type: application/json" \
        --data "{
        \"amount\": \"100.00\"
    }"

    const url = new URL(
        "http://192.168.110.10/api/user/withdraw"
    );

    const headers = {
        "Authorization": "Bearer 69|KO7sJGJlD0AxUDOxnKf5uEs4AnvEJKeRQG527cns36375743",
        "Content-Type": "application/json",
        "Accept": "application/json",
    };

    let body = {
        "amount": "100.00"
    };

    fetch(url, {
        method: "POST",
        headers,
        body: JSON.stringify(body),
    }).then(response => response.json());

    $client = new \GuzzleHttp\Client();
    $url = 'http://192.168.110.10/api/user/withdraw';
    $response = $client->post(
        $url,
        [
            'headers' => [
                'Authorization' => 'Bearer 69|KO7sJGJlD0AxUDOxnKf5uEs4AnvEJKeRQG527cns36375743',
                'Content-Type' => 'application/json',
            ],
            'json' => [
                'amount' => '100.00',
            ],
        ]
    );
    $body = $response->getBody();
    print_r(json_decode((string) $body));

> Example response (200):

    {
        "code": 200,
        "message": "提现成功",
        "data": null
    }

> Received response:

> Request failed with error:

    Tip: Check that you're properly connected to the network.
    If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
    You can check the Dev Tools console for debugging information.

### Request

POST `api/user/withdraw`

#### Headers

`Authorization`

Example: `Bearer 69|KO7sJGJlD0AxUDOxnKf5uEs4AnvEJKeRQG527cns36375743`

`Content-Type`

Example: `application/json`

#### Body Parameters

`amount` decimal optional

提现金额. Example: `100.00`

## [用户管理] 用户反馈

requires authentication

提交用户的反馈信息

> Example request:

    curl --request POST \
        "http://192.168.110.10/api/user/feedback" \
        --header "Authorization: Bearer 69|KO7sJGJlD0AxUDOxnKf5uEs4AnvEJKeRQG527cns36375743" \
        --header "Content-Type: application/json" \
        --data "{
        \"content\": \"这是一个反馈信息\"
    }"

    const url = new URL(
        "http://192.168.110.10/api/user/feedback"
    );

    const headers = {
        "Authorization": "Bearer 69|KO7sJGJlD0AxUDOxnKf5uEs4AnvEJKeRQG527cns36375743",
        "Content-Type": "application/json",
        "Accept": "application/json",
    };

    let body = {
        "content": "这是一个反馈信息"
    };

    fetch(url, {
        method: "POST",
        headers,
        body: JSON.stringify(body),
    }).then(response => response.json());

    $client = new \GuzzleHttp\Client();
    $url = 'http://192.168.110.10/api/user/feedback';
    $response = $client->post(
        $url,
        [
            'headers' => [
                'Authorization' => 'Bearer 69|KO7sJGJlD0AxUDOxnKf5uEs4AnvEJKeRQG527cns36375743',
                'Content-Type' => 'application/json',
            ],
            'json' => [
                'content' => '这是一个反馈信息',
            ],
        ]
    );
    $body = $response->getBody();
    print_r(json_decode((string) $body));

> Example response (200):

    {
        "code": 200,
        "message": "提交成功",
        "data": null
    }

> Received response:

> Request failed with error:

    Tip: Check that you're properly connected to the network.
    If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
    You can check the Dev Tools console for debugging information.

### Request

POST `api/user/feedback`

#### Headers

`Authorization`

Example: `Bearer 69|KO7sJGJlD0AxUDOxnKf5uEs4AnvEJKeRQG527cns36375743`

`Content-Type`

Example: `application/json`

#### Body Parameters

`content` string optional

反馈内容. Example: `这是一个反馈信息`

## [用户管理] 申请成为技师

requires authentication

申请成为技师

> Example request:

    curl --request POST \
        "http://192.168.110.10/api/user/apply-coach" \
        --header "Authorization: Bearer 69|KO7sJGJlD0AxUDOxnKf5uEs4AnvEJKeRQG527cns36375743"

    const url = new URL(
        "http://192.168.110.10/api/user/apply-coach"
    );

    const headers = {
        "Authorization": "Bearer 69|KO7sJGJlD0AxUDOxnKf5uEs4AnvEJKeRQG527cns36375743",
        "Accept": "application/json",
    };

    fetch(url, {
        method: "POST",
        headers,
    }).then(response => response.json());

    $client = new \GuzzleHttp\Client();
    $url = 'http://192.168.110.10/api/user/apply-coach';
    $response = $client->post(
        $url,
        [
            'headers' => [
                'Authorization' => 'Bearer 69|KO7sJGJlD0AxUDOxnKf5uEs4AnvEJKeRQG527cns36375743',
            ],
        ]
    );
    $body = $response->getBody();
    print_r(json_decode((string) $body));

> Example response (200):

    {
        "code": 200,
        "message": "申请成功",
        "data": null
    }

> Received response:

> Request failed with error:

    Tip: Check that you're properly connected to the network.
    If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
    You can check the Dev Tools console for debugging information.

### Request

POST `api/user/apply-coach`

#### Headers

`Authorization`

Example: `Bearer 69|KO7sJGJlD0AxUDOxnKf5uEs4AnvEJKeRQG527cns36375743`