- ID
- 74a57e06-50c6-4ecb-9b13-4b4ef4bbe49c
- ROAM_ALIASES
- "Re-invite inactive user with public API" ENG-14595
ENG-14595 - When re-activating user via public API invited user should be re-invited
- source :: https://15five-dev.atlassian.net/browse/ENG-14595
Description
Issue
Create a new user
#+begin_src restclient
# This endpoint does not exist, it probably should
POST :root_path/api/public/user/
Authorization: Bearer :api_key
# {"email": "eng14595@15five.com", "first_name": "Jira", "last_name": "ENG-14595"}
# Instead, copy and past the curl command here:
# curl -k -v -H "Authorization: Bearer 1111-1111-1111-1111" -F 'csv_file=@"/home/powellc/var/org/.attach/71/99d7d6-c386-4fcc-add6-4410efaed038/eng14595.csv"' https://five.unbl.ink/api/public/bulk-user-import/
#+end_src
Deactivate user
#+begin_src restclient
:root_path := "https://five.unbl.ink"
:api_key := "1111-1111-1111-1111"
# Deactivate the user, user should be in expired invites
PUT :root_path/api/public/user/3009?debug_api=true
Authorization: Bearer :api_key
Content-Type: application/json
{"is_active": "false"}
#
#+end_src
#+RESULTS:
#+BEGIN_SRC js
{
"id": 3009,
"first_name": "API Bulk",
"last_name": "Tester",
"email": "api-bulk-test@15five.com",
"location": "",
"employee_id": "1",
"title": null,
"phone": null,
"reviewer_id": null,
"company_groups_ids": [],
"skip_company_wide_questions": false,
"is_active": false,
"reporting_period": null,
"due_day": 4,
"biweekly_due_day": 4,
"biweekly_due_day_which_week": "even",
"monthly_due_day": 4,
"monthly_due_day_which_in_month": "-1",
"is_reporter": false,
"is_reviewer": false,
"last_login_ts": null,
"first_login_ts": null,
"is_company_admin": false
}
// PUT https://five.unbl.ink/api/public/user/3009?debug_api=true
// HTTP/1.1 200 OK
// Allow: GET, PUT
// Content-Language: en-US
// Content-Length: 506
// Content-Type: application/json
// Server: Caddy
// Set-Cookie: django_language=en-US; Path=/
// Vary: Accept, Authorization, Cookie
// X-Frame-Options: SAMEORIGIN
// Date: Mon, 08 Feb 2021 21:15:52 GMT
// Request duration: 6.167142s
#+END_SRC
Re-activate user
#+begin_src restclient
:root_path := "https://five.unbl.ink"
:api_key := "1111-1111-1111-1111"
# Reactivate the user, user should be in invited section again
PUT :root_path/api/public/user/3009?debug_api=true
Authorization: Bearer :api_key
Content-Type: application/json
{"is_active": "true"}
#
#+end_src
#+RESULTS:
#+BEGIN_SRC js
{
"id": 3009,
"first_name": "API Bulk",
"last_name": "Tester",
"email": "api-bulk-test@15five.com",
"location": "",
"employee_id": "1",
"title": null,
"phone": null,
"reviewer_id": null,
"company_groups_ids": [],
"skip_company_wide_questions": false,
"is_active": true,
"reporting_period": null,
"due_day": 4,
"biweekly_due_day": 4,
"biweekly_due_day_which_week": "even",
"monthly_due_day": 4,
"monthly_due_day_which_in_month": "-1",
"is_reporter": false,
"is_reviewer": false,
"last_login_ts": null,
"first_login_ts": null,
"is_company_admin": false
}
// PUT https://five.unbl.ink/api/public/user/3009?debug_api=true
// HTTP/1.1 200 OK
// Allow: GET, PUT
// Content-Language: en-ck
// Content-Length: 505
// Content-Type: application/json
// Server: Caddy
// Set-Cookie: django_language=en-ck; Path=/
// Set-Cookie: messages="667ece028299d0fa554f14ad76fce9f7808d253d$[[\"__json_message\"\0540\05430\054\"/api/public/user/3009/?debug_api=true: Elapsed time for this view (20.37 seconds) exceeded max threshold of 5 seconds\"\054\"sticky\"]\054[\"__json_message\"\0540\05430\054\"/api/public/user/3009/?debug_api=true: Number of queries for this view (415 queries) exceeded max threshold of 50 queries\"\054\"sticky\"]]"; Domain=five.unbl.ink; HttpOnly; Path=/
// Vary: Accept, Authorization, Cookie
// X-Frame-Options: SAMEORIGIN
// Date: Mon, 08 Feb 2021 20:19:54 GMT
// Request duration: 20.443972s
#+END_SRC
Attachments
Test CSV file
- ID
- 7199d7d6-c386-4fcc-add6-4410efaed038