Introduction
Owl Admin API 接口文档
欢迎使用 Owl Admin API 接口文档。
该文档提供了所有可用的API接口信息。
Authenticating requests
To authenticate requests, include an Authorization
header with the value "Bearer 171|4wDLRqkRn3A5mQm3b5l9gelKO8BijUZKZrgVugt544296a98"
.
All authenticated endpoints are marked with a requires authentication
badge in the documentation below.
通过登录接口获取 token,格式为 Bearer {token}
更新API文档的认证Token
requires authentication
通过手机号获取验证码并登录,然后更新API文档的认证Token
Example request:
const url = new URL(
"http://127.0.0.1/api/scribe/update-token/13800138000"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "http://127.0.0.1/api/scribe/update-token/13800138000" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}"
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.
用户端-地址管理
用户地址相关的API接口
获取默认地址2
requires authentication
Example request:
const url = new URL(
"http://127.0.0.1/api/address/default"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "http://127.0.0.1/api/address/default" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}"
Example response (200):
{
"code": 200,
"message": "success",
"data": {
"id": 1,
"user_id": 1,
"name": "张三",
"phone": "13800138000",
"province": "广东省",
"city": "深圳市",
"district": "南山区",
"address": "科技园",
"is_default": 1,
"created_at": "2024-01-01 00:00:00",
"updated_at": "2024-01-01 00:00:00"
}
}
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.
添加地址
requires authentication
Example request:
const url = new URL(
"http://127.0.0.1/api/address"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"phone": "13800138000",
"province": "广东省",
"city": "深圳市",
"district": "南山区",
"longitude": "113.93041",
"latitude": "22.53332",
"area_code": "440305",
"is_default": true,
"location": "科技园",
"detail": "科技园南区"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"http://127.0.0.1/api/address" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--data "{
\"phone\": \"13800138000\",
\"province\": \"广东省\",
\"city\": \"深圳市\",
\"district\": \"南山区\",
\"longitude\": \"113.93041\",
\"latitude\": \"22.53332\",
\"area_code\": \"440305\",
\"is_default\": true,
\"location\": \"科技园\",
\"detail\": \"科技园南区\"
}"
Example response (200):
{
"code": 200,
"message": "添加成功"
}
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.
修改地址
requires authentication
Example request:
const url = new URL(
"http://127.0.0.1/api/address/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"phone": "13800138000",
"province": "广东省",
"city": "深圳市",
"district": "南山区",
"longitude": "113.93041",
"latitude": "22.53332",
"area_code": "440305",
"is_default": true,
"location": "科技园",
"detail": "科技园南区"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
"http://127.0.0.1/api/address/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--data "{
\"phone\": \"13800138000\",
\"province\": \"广东省\",
\"city\": \"深圳市\",
\"district\": \"南山区\",
\"longitude\": \"113.93041\",
\"latitude\": \"22.53332\",
\"area_code\": \"440305\",
\"is_default\": true,
\"location\": \"科技园\",
\"detail\": \"科技园南区\"
}"
Example response (200):
{
"code": 200,
"message": "修改成功"
}
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.
删除地址
requires authentication
Example request:
const url = new URL(
"http://127.0.0.1/api/address/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
curl --request DELETE \
"http://127.0.0.1/api/address/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}"
Example response (200):
{
"code": 200,
"message": "删除成功"
}
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.
设置默认地址
requires authentication
Example request:
const url = new URL(
"http://127.0.0.1/api/address/1/default"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Accept": "application/json",
};
fetch(url, {
method: "PUT",
headers,
}).then(response => response.json());
curl --request PUT \
"http://127.0.0.1/api/address/1/default" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}"
Example response (200):
{
"code": 200,
"message": "设置成功"
}
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.
用户端-技师定位管理
技师定位相关的API接口
获取定位列表
requires authentication
Example request:
const url = new URL(
"http://127.0.0.1/api/coach/location"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "http://127.0.0.1/api/coach/location" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}"
Example response (200):
{
"code": 200,
"message": "获取成功",
"data": [
{
"id": 1,
"type": "home",
"latitude": 34.0522,
"longitude": -118.2437,
"city": "Los Angeles",
"district": "Downtown",
"location": "123 Main St",
"area_code": "90001"
}
]
}
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.
创建定位
requires authentication
Example request:
const url = new URL(
"http://127.0.0.1/api/coach/location"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"type": "home",
"latitude": 34.0522,
"longitude": -118.2437,
"city": "Los Angeles",
"district": "Downtown",
"location": "123 Main St",
"area_code": "90001"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"http://127.0.0.1/api/coach/location" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--data "{
\"type\": \"home\",
\"latitude\": 34.0522,
\"longitude\": -118.2437,
\"city\": \"Los Angeles\",
\"district\": \"Downtown\",
\"location\": \"123 Main St\",
\"area_code\": \"90001\"
}"
Example response (200):
{
"code": 200,
"message": "创建成功",
"data": {
"id": 1,
"type": "home",
"latitude": 34.0522,
"longitude": -118.2437,
"city": "Los Angeles",
"district": "Downtown",
"location": "123 Main St",
"area_code": "90001"
}
}
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.
删除定位
requires authentication
Example request:
const url = new URL(
"http://127.0.0.1/api/coach/location/quis"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"coach_id": 1,
"type": "home"
};
fetch(url, {
method: "DELETE",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request DELETE \
"http://127.0.0.1/api/coach/location/quis" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--data "{
\"coach_id\": 1,
\"type\": \"home\"
}"
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.
用户端-技师管理
技师相关的API接口
获取技师列表
requires authentication
根据经纬度获取技师列表
Example request:
const url = new URL(
"http://127.0.0.1/api/coach"
);
const params = {
"latitude": "34.0522",
"longitude": "-118.2437",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "http://127.0.0.1/api/coach?latitude=34.0522&longitude=-118.2437" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}"
Example response (200):
{
"code": 200,
"message": "获取成功",
"data": [
{
"id": 1,
"name": "技师A",
"latitude": 34.0522,
"longitude": -118.2437
}
]
}
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.
获取技师详情
requires authentication
根据ID获取技师的详细信息
Example request:
const url = new URL(
"http://127.0.0.1/api/coach/1"
);
const params = {
"latitude": "34.0522",
"longitude": "-118.2437",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "http://127.0.0.1/api/coach/1?latitude=34.0522&longitude=-118.2437" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}"
Example response (200):
{
"code": 200,
"message": "获取成功",
"data": {
"id": 1,
"name": "技师A",
"latitude": 34.0522,
"longitude": -118.2437,
"details": "详细信息"
}
}
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.
用户端-用户管理
用户相关的API接口
获取用户信息
requires authentication
获取当前用户的信息
Example request:
const url = new URL(
"http://127.0.0.1/api/user"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "http://127.0.0.1/api/user" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}"
Example response (200):
{
"code": 200,
"message": "获取成功",
"data": {
"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.
修改用户信息
requires authentication
修改当前用户的信息
Example request:
const url = new URL(
"http://127.0.0.1/api/user"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"nickname": "用户昵称",
"avatar": "https:\/\/example.com\/avatar.jpg"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
"http://127.0.0.1/api/user" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--data "{
\"nickname\": \"用户昵称\",
\"avatar\": \"https:\\/\\/example.com\\/avatar.jpg\"
}"
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.
获取用户钱包
requires authentication
获取当前用户的钱包信息
Example request:
const url = new URL(
"http://127.0.0.1/api/user/wallet"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "http://127.0.0.1/api/user/wallet" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}"
Example response (200):
{
"code": 200,
"message": "获取成功",
"data": {
"balance": 100,
"freeze": 0
}
}
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.
用户提现
requires authentication
提现用户的余额
Example request:
const url = new URL(
"http://127.0.0.1/api/user/withdraw"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"amount": "100.00",
"type": "wechat",
"area_code": "330100"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"http://127.0.0.1/api/user/withdraw" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--data "{
\"amount\": \"100.00\",
\"type\": \"wechat\",
\"area_code\": \"330100\"
}"
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.
申请成为技师
requires authentication
申请成为技师
Example request:
const url = new URL(
"http://127.0.0.1/api/user/apply-coach"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"mobile": "13800138000",
"gender": "male",
"work_years": "5",
"intention_city": "杭州"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"http://127.0.0.1/api/user/apply-coach" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--data "{
\"mobile\": \"13800138000\",
\"gender\": \"male\",
\"work_years\": \"5\",
\"intention_city\": \"杭州\"
}"
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.
用户端-订单管理
订单相关的API接口
订单初始化
requires authentication
初始化订单
Example request:
const url = new URL(
"http://127.0.0.1/api/orders/initialize"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"coach_id": 1,
"area_code": "370602",
"project_id": 1
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"http://127.0.0.1/api/orders/initialize" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--data "{
\"coach_id\": 1,
\"area_code\": \"370602\",
\"project_id\": 1
}"
Example response (200):
{
"status": "success",
"data": {}
}
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.
创建订单
requires authentication
创建订单
Example request:
const url = new URL(
"http://127.0.0.1/api/orders/create"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"project_id": 1,
"address_id": 1,
"coach_id": 6,
"use_balance": false,
"service_time": "2024-01-01 10:00:00",
"order_id": null
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"http://127.0.0.1/api/orders/create" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--data "{
\"project_id\": 1,
\"address_id\": 1,
\"coach_id\": 6,
\"use_balance\": false,
\"service_time\": \"2024-01-01 10:00:00\",
\"order_id\": null
}"
Example response (200):
{
"status": "success",
"data": {}
}
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.
取消订单
requires authentication
取消订单
Example request:
const url = new URL(
"http://127.0.0.1/api/orders/cancel"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"order_id": 123
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"http://127.0.0.1/api/orders/cancel" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--data "{
\"order_id\": 123
}"
Example response (200):
{
"status": "success",
"data": {}
}
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.
结束订单
requires authentication
结束订单
Example request:
const url = new URL(
"http://127.0.0.1/api/orders/finish"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"order_id": 1
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"http://127.0.0.1/api/orders/finish" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--data "{
\"order_id\": 1
}"
Example response (200):
{
"status": "success",
"data": {}
}
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.
确认技师离开
requires authentication
确认技师离开
Example request:
const url = new URL(
"http://127.0.0.1/api/orders/confirm-leave"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"order_id": 123
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"http://127.0.0.1/api/orders/confirm-leave" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--data "{
\"order_id\": 123
}"
Example response (200):
{
"status": "success",
"data": {}
}
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.
获取订单列表
requires authentication
获取订单列表
Example request:
const url = new URL(
"http://127.0.0.1/api/orders/list"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "http://127.0.0.1/api/orders/list" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}"
Example response (200):
{
"status": "success",
"data": []
}
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.
获取订单详情
requires authentication
获取订单详情
Example request:
const url = new URL(
"http://127.0.0.1/api/orders/detail/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "http://127.0.0.1/api/orders/detail/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}"
Example response (200):
{
"status": "success",
"data": {}
}
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.
用户端-项目管理
项目相关的API接口
获取项目列表
requires authentication
根据区域代码获取项目列表
Example request:
const url = new URL(
"http://127.0.0.1/api/project"
);
const params = {
"area_code": "330100",
"project_cate_id": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "http://127.0.0.1/api/project?area_code=330100&project_cate_id=1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}"
Example response (200):
{
"code": 200,
"message": "获取成功",
"data": {
"current_page": 1,
"data": [
{
"id": 1,
"name": "项目名称",
"description": "项目描述",
"price": "100.00",
"duration": 60,
"category": {
"id": 1,
"name": "分类名称"
}
}
],
"total": 10,
"per_page": 10
}
}
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.
获取项目详情
requires authentication
获取指定项目的详细信息
Example request:
const url = new URL(
"http://127.0.0.1/api/project/1/detail"
);
const params = {
"area_code": "330100",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "http://127.0.0.1/api/project/1/detail?area_code=330100" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}"
Example response (200):
{
"code": 200,
"message": "获取成功",
"data": {
"id": 1,
"name": "项目名称",
"description": "项目描述",
"price": "100.00",
"duration": 60,
"category": {
"id": 1,
"name": "分类名称"
},
"agent": {
"id": 1,
"name": "代理商名称",
"contact": "联系人",
"mobile": "13800138000"
}
}
}
Example response (400):
{
"code": 400,
"message": "该区域暂无代理商"
}
Example response (404):
{
"code": 404,
"message": "项目不存在"
}
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.
获取技师项目列表
requires authentication
获取指定技师已开通的项目列表
Example request:
const url = new URL(
"http://127.0.0.1/api/project/coach-list"
);
const params = {
"coach_id": "1",
"area_code": "330100",
"project_cate_id": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
curl --request GET \
--get "http://127.0.0.1/api/project/coach-list?coach_id=1&area_code=330100&project_cate_id=1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}"
Example response (200):
{
"code": 200,
"message": "获取成功",
"data": {
"current_page": 1,
"data": [
{
"id": 1,
"name": "项目名称",
"description": "项目描述",
"price": "100.00",
"duration": 60,
"category": {
"id": 1,
"name": "分类名称"
}
}
],
"total": 10,
"per_page": 10
}
}
Example response (404):
{
"code": 404,
"message": "技师不存在或未通过认证"
}
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.
账户管理
包含登录、注册、账户管理等基础功能
发送验证码
requires authentication
向指定手机号发送验证码
Example request:
const url = new URL(
"http://127.0.0.1/api/account/send-code"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"mobile": "13800138000"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
"http://127.0.0.1/api/account/send-code" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--data "{
\"mobile\": \"13800138000\"
}"
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.
用户登录
requires authentication
使用手机号和验证码登录账户
Example request:
const url = new URL(
"http://127.0.0.1/api/account/login"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"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());
curl --request POST \
"http://127.0.0.1/api/account/login" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--data "{
\"mobile\": \"13800138000\",
\"code\": \"123456\"
}"
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.
微信登录
requires authentication
使用微信openid登录账户
Example request:
const url = new URL(
"http://127.0.0.1/api/account/wx-login"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"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());
curl --request POST \
"http://127.0.0.1/api/account/wx-login" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--data "{
\"openid\": \"wx_123456789\"
}"
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.
用户退出
requires authentication
退出当前账户登录状态
Example request:
const url = new URL(
"http://127.0.0.1/api/account/logout"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());
curl --request POST \
"http://127.0.0.1/api/account/logout" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}"
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.
用户注销
requires authentication
永久注销当前账户
Example request:
const url = new URL(
"http://127.0.0.1/api/account"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
curl --request DELETE \
"http://127.0.0.1/api/account" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}"
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.