店铺用户登录和CRM
金色童年
店铺用户登录后获取个人用户信息,用 is_shop 字段判断是否店铺用户
获取店铺信息
Method and URL Structure
| Method |
Resource URL |
| GET |
/shop/whoami/ |
Request Paramaters
No Applicatated
cURL Example
curl -H 'Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b'\ http://localhost/shop/whoami/
Response
{ "pk":18, "owner":39, "name":"店三", "avatar_url":"http://pic.example.com/0.jpg", "region":"华东地区", "province":"上海", "city":"上海市", "district":"浦东新区", "address":"云里路", "linkman":"13212345671", "desc":"店铺介绍", "position":"31.21843415810747,121.55334830694574", "completed":false}
获取客户列表
Method and URL Structure
| Method |
Resource URL |
| GET |
/shop/clients/ |
cURL Example
curl -H 'Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b' http://localhost/shop/clients/
Response
{ "count":4, "next":null, "previous":null, "results":[{ "username":"test_004", "nickname": "昵称", "owner": 123, "is_star":false, "interview":{ "pk":8, "created":"2016-11-22T18:31:30.779426" "text": "测试访问第一", } },...]}
获取星标客户 id 列表, 添加、删除星标用户
Method and URL Structure
| Method |
Resource URL |
| GET |
/shop/star_clients/ |
| POST |
/shop/star_client/add/ |
| DELETE |
/shop/star_client/delete/ |
Request Data
{ 'user_id': 99}
cURL Example
curl -H 'Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b' http://localhost/shop/start_clients/
Reponse
{ "status":0, "star_client_list":["60","59","58"], "message":""}
获取访问列表
Method and URL Structure
| Method |
Resource URL |
| GET |
/shop/interviews/ |
Request Paramaters
{ "user_id": 33}
cURL Example
curl -H 'Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b' http://localhost/shop/interviews/?user=33
Reponse
{ "count":2, "next":null, "previous":null, "results":[{ "pk":7, "shop":10, "user":33, "text":"测试访问第一", "created":"2016-11-21T21:36:27.844735" },...]}
获取、添加、删除用户访问
Method and URL Structure
| Method |
Resource URL |
| GET |
/shop/interview/${pk}/ |
| POST |
/shop/interview/create/ |
| DELETE |
/shop/interview/delete/${pk} |
Request Data
{ "user": 33, "text": "测试访问第一",}
cURL Example
curl -X POST -H 'Content-Type: application/json' -H 'Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b' --data '{...}' http://localhost/shop/interview/134/
Reponse
{ "pk":3, "shop":9, "user":33, "text":"测试访问第一", "created":"2016-11-21T21:36:26.769269"}
获取备注列表
Method and URL Structure
| Method |
Resource URL |
| GET |
/shop/ramarks/ |
Request Paramaters
{ "user_id": 33}
cURL Example
curl -H 'Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b' http://localhost/shop/remarks/?user_id=33
Reponse
{ "count":2, "next":null, "previous":null, "results":[{ "pk":7, "shop":10, "user":33, "text":"测试备注第一", "created":"2016-11-21T21:36:27.844735" },...]}
获取、添加、删除用户备注
Method and URL Structure
| Method |
Resource URL |
| GET |
/shop/remark/${pk}/ |
| POST |
/shop/remark/create/ |
| DELETE |
/shop/remark/delete/${pk} |
Request Data
{ "user": 33, "text": "测试访问第一",}
cURL Example
curl -X POST -H 'Content-Type: application/json' -H 'Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b' --data '{...}' http://localhost/shop/remark/134/
Reponse
{ "pk":3, "shop":9, "user":33, "text":"测试访问第一", "created":"2016-11-21T21:36:26.769269"}
给客户发短信
Method and URL Structure
| Method |
Resource URL |
| POST |
/shop/client/send_message/${username}/ |
Request Data
{ "text": "Hello! Welcome!",}
cURL Example
curl -X POST -H 'Content-Type: application/json' -H 'Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b' --data '{...}' http://localhost/shop/client/send_message/12345678910/