[关闭]
@chengxuyuan 2021-07-16T07:56:13.000000Z 字数 5789 阅读 421

学员相关接口文档

销售系统


获取老师列表

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
GET /crm/account/list_teacher/ 老师列表 NO

cURL Example

  1. curl -X GET http://127.0.0.1:8000/crm/account/list_teacher/ -H 'Content-Type: application/json' -H 'Authorization: Token f5d99e3acf2b3e76d63d4a8a8a2389d86e43d9cc'

Response

  1. {
  2. "count": 1,
  3. "next": null,
  4. "previous": null,
  5. "results": [
  6. {
  7. "id": 1,
  8. "pk": 1,
  9. "deleted": false,
  10. "create_time": "2020-10-23T15:36:32.884851",
  11. "order_index": 1000,
  12. "name": "小明老师"
  13. }
  14. ]
  15. }

获取学员来源分类列表

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
GET /crm/account/list_source_category/ 来源分类列表 NO

Response

  1. {
  2. "count": 3,
  3. "next": null,
  4. "previous": null,
  5. "results": [
  6. {
  7. "pk": 3,
  8. "name": "dsfs",
  9. "sources": []
  10. },
  11. {
  12. "pk": 2,
  13. "name": "ddds",
  14. "sources": [
  15. {
  16. "pk": 3,
  17. "name": "TMK外呼电话邀约",
  18. "category": 2
  19. }
  20. ]
  21. },
  22. {
  23. "pk": 1,
  24. "name": "ddd",
  25. "sources": [
  26. {
  27. "pk": 2,
  28. "name": "S主动注册试听",
  29. "category": 1
  30. },
  31. {
  32. "pk": 1,
  33. "name": "R老生转介绍",
  34. "category": 1
  35. }
  36. ]
  37. }
  38. ]
  39. }

获取学员来源列表

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
GET /crm/account/list_source/ 来源列表 NO

Response

  1. {
  2. "count": 3,
  3. "next": null,
  4. "previous": null,
  5. "results": [
  6. {
  7. "pk": 3,
  8. "name": "TMK外呼电话邀约",
  9. "category": 2
  10. },
  11. {
  12. "pk": 2,
  13. "name": "S主动注册试听",
  14. "category": 1
  15. },
  16. {
  17. "pk": 1,
  18. "name": "R老生转介绍",
  19. "category": 1
  20. }
  21. ]
  22. }

获取学员阶段列表

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
GET /crm/account/list_stage/ 阶段列表 NO

Request Parameters

Name Description Example
other_username 销售工号 other_username=cxy004
is_expired 是否过期 is_expired=False
tag 筛选时间tag 本月:month; 上月:last_month; 上上月:lasts_month
start_date 筛选开始时间 start_date=2021-07-13
current_date 筛选结束时间 current_date=2021-07-13
exclude_stage 排除的阶段 exclude_stage=20,15,13

Response

  1. {
  2. "count": 7,
  3. "next": null,
  4. "previous": null,
  5. "results": [
  6. {
  7. "pk": 13,
  8. "name": "年龄不符",
  9. "content": "",
  10. "stage_count": 0
  11. },
  12. {
  13. "pk": 14,
  14. "name": "无意向",
  15. "content": "",
  16. "stage_count": 0
  17. },
  18. {
  19. "pk": 15,
  20. "name": "未测试",
  21. "content": "",
  22. "stage_count": 0
  23. },
  24. {
  25. "pk": 17,
  26. "name": "已安排",
  27. "content": "",
  28. "stage_count": 0
  29. },
  30. {
  31. "pk": 18,
  32. "name": "新建",
  33. "content": "",
  34. "stage_count": 0
  35. },
  36. {
  37. "pk": 11,
  38. "name": "已购买",
  39. "content": "",
  40. "stage_count": 310
  41. },
  42. {
  43. "pk": 6,
  44. "name": "已试听",
  45. "content": "",
  46. "stage_count": 0
  47. }
  48. ]
  49. }

获取预推课程列表

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
GET /crm/account/list_course/ 课程列表 NO

Response

  1. {
  2. "count": 2,
  3. "next": null,
  4. "previous": null,
  5. "results": [
  6. {
  7. "pk": 2,
  8. "name": "编程创作",
  9. "content": ""
  10. },
  11. {
  12. "pk": 1,
  13. "name": "编程思维",
  14. "content": ""
  15. }
  16. ]
  17. }

新建学员

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
POST /crm/account/create_student/ 新建学员 YES

Request Parameters

Name Description Required Default
wx_number 微信号 NO
phone 手机号 NO
name 姓名 NO
current_stage 当前阶段pk NO
source 来源pk NO
teacher 老师pk NO
course 预推课程的 pk NO
remark 备注 NO
province 省份 NO
city 城市 NO
age 年龄 NO

Request Data

  1. {
  2. "source":1,
  3. "current_stage":1,
  4. "course":1,
  5. "name":"陈微",
  6. "wx_number":"1846208953",
  7. "phone":"15201052255",
  8. "teacher":1
  9. }

cURL Example

  1. curl -X POST -H 'Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b' http://127.0.0.1:8000/account/create_student/

Response

  1. {
  2. "pk": 25,
  3. "saler": "001",
  4. "wx_number": "1846208953",
  5. "phone": null,
  6. "name": null,
  7. "remark": "",
  8. "operate_time": "2019-05-07T07:43:54.717052Z",
  9. "source": {
  10. "pk": 1,
  11. "name": "R老生转介绍"
  12. },
  13. "teacher": {
  14. "pk": 2,
  15. "name": "小明老师"
  16. },
  17. "current_stage": null,
  18. "course": null,
  19. "age": 0,
  20. "province": "",
  21. "city": ""
  22. }

学员列表、学员搜索、学员过滤

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
GET /crm/account/list_student/ 获取销售员下所有学员 YES

cURL Example

  1. curl -X GET -H 'Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b' http://127.0.0.1:8000/account/list_student/

Response

  1. {
  2. "count": 1,
  3. "next": null,
  4. "previous": null,
  5. "results": [
  6. {
  7. "pk": 16,
  8. "wx_number": "1846208953",
  9. "phone": "15201052252",
  10. "name": "陈微",
  11. "remark": null,
  12. "operate_time": "2019-03-26T13:27:29",
  13. "source": {
  14. "pk": 2,
  15. "name": "S主动注册试听"
  16. },
  17. "teacher": {
  18. "pk": 2,
  19. "name": "小明老师"
  20. },
  21. "current_stage": {
  22. "pk": 2,
  23. "name": "2A阶段 微信已联系(已回复)",
  24. "content": "",
  25. "stage_time": "2019-03-26T13:27:29"
  26. }
  27. }
  28. ]
  29. }

学员信息修改

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
PUT /crm/account/update_student/${pk}/ 修改学员信息 YES

Request Parameters

Name Description Required Default
wx_number 微信号 YES
phone 手机号 YES
name 姓名 YES
current_stage 当前阶段pk YES
source 来源pk YES
remark 备注 NO
teacher 老师pk NO

Request Data

  1. {
  2. "source":2,
  3. "teacher":2,
  4. "wx_number":"18462053",
  5. "current_stage":3,
  6. "name":"陈微fa",
  7. "phone":"15201052253",
  8. "remark":"dsgafjs"
  9. }

Response

  1. {
  2. "pk": 18,
  3. "wx_number": "18462053",
  4. "phone": "15201052253",
  5. "name": "陈微fa",
  6. "remark": "dsgafjs",
  7. "operate_time": "2019-03-26T13:37:46.941053",
  8. "source": {
  9. "pk": 2,
  10. "name": "S主动注册试听"
  11. },
  12. "teacher": {
  13. "pk": 2,
  14. "name": "小明老师"
  15. },
  16. "current_stage": {
  17. "pk": 3,
  18. "name": "2B阶段 微信联系后的第2天(未回复)",
  19. "content": ""
  20. }
  21. }

学员信息批量修改

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
PUT /crm/account/batch_update_student/ 批量修改 YES

Request Parameters

Name Description Required Default
student_ids 学员id组 YES
wx_number 微信号 No
phone 手机号 No
name 姓名 No
remark 备注 NO
current_stage_id 当前阶段pk No
source_id 来源pk No
teacher_id 老师pk NO
course_id 预推课程id NO
saler 销售人员账号 NO

Request Data

  1. {
  2. "student_ids":[1,2,3],
  3. "source_id":2,
  4. "teacher_id":2,
  5. "wx_number":"18462053",
  6. "current_stage_id":3,
  7. "name":"陈微fa",
  8. "phone":"15201052253",
  9. "remark":"dsgafjs"
  10. }

Response

  1. {
  2. "status": 0,
  3. "message": ""
  4. }

学员信息获取

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
GET /crm/account/detail_student/${pk}/ 获取学员信息 YES

Response

  1. {
  2. "pk": 18,
  3. "wx_number": "18462053",
  4. "phone": "15201052253",
  5. "name": "陈微fa",
  6. "remark": "dsgafjs",
  7. "operate_time": "2019-03-26T13:37:46.941053",
  8. "source": {
  9. "pk": 2,
  10. "name": "S主动注册试听"
  11. },
  12. "current_stage": {
  13. "pk": 3,
  14. "name": "2B阶段 微信联系后的第2天(未回复)",
  15. "content": ""
  16. }
  17. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注