Note
This help should be accurate and comprehensive. If you see anything missing or that needs to be fixed, see How to Contribute or let us know in the Juice Slack #documentation channel.
The Users endpoints provide a way to view user details, as well, as update, deactivate and control user access to applications.
GET
/api/v1/jb/users/
¶Get a list of Users
Example Request:
GET /api/v1/jb/users/
Accept: application/json
Authorization: Token 7297b3ebb0e7f7baf5f54d39908dda99f5ea8665
Example Response:
HTTP/1.1 200 OK
Vary: Accept
Content-Type: text/javascript
[
{
"extra": { },
"last_login": "2016-06-01T13:34:30.718746Z",
"email": "user@juice.com",
"handle": "@user",
"first_name": "User",
"last_name": "User",
"is_active": true,
"date_joined": "2013-07-28T21:04:32Z",
"is_demo_user": false,
"profile_color": "ff0000",
"profile_avatar": "https://fruition-snapshots.s3.amazonaws.com/avatars/profile-defaults/o.png",
"last_activated": "2016-06-01T13:22:24.439209Z",
"last_deactivated": null,
"apps": [
"zylTKNVx"
],
"clientadmin_of": []
}
]
Response JSON Object: | |
---|---|
|
|
Request Headers: | |
|
|
Response Headers: | |
|
|
Status Codes: |
|
GET
/api/v1/jb/users/?app={slug}
¶Get a list of Users for an app
Example Request:
GET /api/v1/jb/users/?app=jb3demo
Accept: application/json
Authorization: Token 7297b3ebb0e7f7baf5f54d39908dda99f5ea8665
Example Response:
HTTP/1.1 200 OK
Vary: Accept
Content-Type: text/javascript
[
{
"extra": { },
"last_login": "2016-06-01T13:34:30.718746Z",
"email": "user@juice.com",
"handle": "@user",
"first_name": "User",
"last_name": "User",
"is_active": true,
"date_joined": "2013-07-28T21:04:32Z",
"is_demo_user": false,
"profile_color": "ff0000",
"profile_avatar": "https://fruition-snapshots.s3.amazonaws.com/avatars/profile-defaults/o.png",
"last_activated": "2016-06-01T13:22:24.439209Z",
"last_deactivated": null,
"apps": [
"zylTKNVx"
],
"clientadmin_of": []
}
]
Response JSON Object: | |
---|---|
|
|
Request Headers: | |
|
|
Response Headers: | |
|
|
Status Codes: |
|
GET
/api/v1/jb/users/
(string: email)/
¶Get a User’s Details
Example Request:
GET /api/v1/jb/users/user@juice.com/
Accept: application/json
Authorization: Token 7297b3ebb0e7f7baf5f54d39908dda99f5ea8665
Example Response:
HTTP/1.1 200 OK
Vary: Accept
Content-Type: text/javascript
{
"extra": { },
"last_login": "2016-06-01T13:34:30.718746Z",
"email": "user@juice.com",
"handle": "@user",
"first_name": "User",
"last_name": "User",
"is_active": true,
"date_joined": "2013-07-28T21:04:32Z",
"is_demo_user": false,
"profile_color": "ff0000",
"profile_avatar": "https://fruition-snapshots.s3.amazonaws.com/avatars/profile-defaults/o.png",
"last_activated": "2016-06-01T13:22:24.439209Z",
"last_deactivated": null,
"apps": [
"zylTKNVx"
],
"clientadmin_of": []
}
Parameters: |
|
---|---|
Response JSON Object: | |
|
|
Request Headers: | |
|
|
Response Headers: | |
|
|
Status Codes: |
|
PATCH
/api/v1/jb/users/
(string: email)/
¶It’s possible to update a user’s first name, last name, active status, demo status, extra data, and assigned applications. Client admins cannot be updated via the API.
Example Request:
PATCH /api/v1/jb/users/user@juice.com/
Accept: application/json
Authorization: Token 7297b3ebb0e7f7baf5f54d39908dda99f5ea8665
{
"apps": [
"zylTKNVx"
]
}
Example Response:
HTTP/1.1 200 OK
Vary: Accept
Content-Type: text/javascript
{
"extra": { },
"last_login": "2016-06-01T13:34:30.718746Z",
"email": "user@juice.com",
"handle": "@user",
"first_name": "User",
"last_name": "User",
"is_active": true,
"date_joined": "2013-07-28T21:04:32Z",
"is_demo_user": false,
"profile_color": "ff0000",
"profile_avatar": "https://fruition-snapshots.s3.amazonaws.com/avatars/profile-defaults/o.png",
"last_activated": "2016-06-01T13:22:24.439209Z",
"last_deactivated": null,
"apps": [
"zylTKNVx"
],
"clientadmin_of": []
}
Parameters: |
|
---|---|
Request JSON Object: | |
|
|
Response JSON Object: | |
|
|
Request Headers: | |
|
|
Response Headers: | |
|
|
Status Codes: |
|
POST
/api/v1/jb/users/
¶Create a user.
Example Request:
POST /api/v1/jb/users/
Accept: application/json
Authorization: Token 7297b3ebb0e7f7baf5f54d39908dda99f5ea8665
{
"email": "new_user@juiceanalytics.com",
"extra": {},
"first_name": "Jane",
"last_name": "Doe",
"is_demo_user": false,
"apps": ["abcdefgh"]
}
Example Response:
HTTP/1.1 200 OK
Vary: Accept
Content-Type: text/javascript
{
"extra": { },
"last_login": "2016-06-01T13:34:30.718746Z",
"email": "new_user@juiceanalytics.com",
"handle": "@new_user",
"first_name": "Jane",
"last_name": "Doe",
"is_active": true,
"date_joined": "2013-07-28T21:04:32Z",
"is_demo_user": false,
"profile_color": "ff0000",
"profile_avatar": "https://fruition-snapshots.s3.amazonaws.com/avatars/profile-defaults/o.png",
"last_activated": "2016-06-01T13:22:24.439209Z",
"last_deactivated": null,
"apps": ["abcdefgh"],
"clientadmin_of": []
}
Request JSON Object: | |
---|---|
|
|
Response JSON Object: | |
|
|
Request Headers: | |
|
|
Response Headers: | |
|
|
Status Codes: |
|
DELETE
/api/v1/jb/users/
(string: email)/
¶Deactivate a User by email
Example Request:
DELETE /api/v1/jb/users/user@juice.com/
Accept: application/json
Authorization: Token 7297b3ebb0e7f7baf5f54d39908dda99f5ea8665
Example Response:
HTTP/1.1 204 NO CONTENT
Vary: Accept, Cookie
Parameters: |
|
---|
GET
/api/v1/jb/users/invitations/
¶Get a list of pending invited users
Example Request:
GET /api/v1/jb/users/invitations/
Accept: application/json
Authorization: Token 7297b3ebb0e7f7baf5f54d39908dda99f5ea8665
Example Response:
HTTP/1.1 200 OK
Vary: Accept
Content-Type: text/javascript
[
{
"id": 3,
"user": {
"extra": {},
"last_login": null,
"email": "jason@juice.com",
"handle": "@jason",
"first_name": "",
"last_name": "",
"is_active": true,
"date_joined": "2016-06-01T18:13:17.943920Z",
"is_demo_user": false,
"profile_color": "ff0000",
"profile_avatar": "https://fruition-snapshots.s3.amazonaws.com/avatars/profile-defaults/default.png",
"last_activated": "2016-06-01T18:13:17.943951Z",
"last_deactivated": null,
"apps": []
},
"initial_apps": [],
"extra": {},
"email": "invited_user@juiceanalytics.com",
"key": "0626d808767dc0abc76a4266ad2df687b3008156",
"date_invited": "2016-06-01T18:24:04.358609Z",
"invitation_email_count": 1
},
]
Response JSON Object: | |
---|---|
|
|
Request Headers: | |
|
|
Response Headers: | |
|
|
Status Codes: |
|
GET
/api/v1/jb/users/invitations/?app={slug}
¶Get a list of pending invited users for an app
Example Request:
GET /api/v1/jb/users/invitations/?app=jb3demo
Accept: application/json
Authorization: Token 7297b3ebb0e7f7baf5f54d39908dda99f5ea8665
Example Response:
HTTP/1.1 200 OK
Vary: Accept
Content-Type: text/javascript
[
{
"id": 3,
"user": {
"extra": {},
"last_login": null,
"email": "jason@juice.com",
"handle": "@jason",
"first_name": "",
"last_name": "",
"is_active": true,
"date_joined": "2016-06-01T18:13:17.943920Z",
"is_demo_user": false,
"profile_color": "ff0000",
"profile_avatar": "https://fruition-snapshots.s3.amazonaws.com/avatars/profile-defaults/default.png",
"last_activated": "2016-06-01T18:13:17.943951Z",
"last_deactivated": null,
"apps": []
},
"initial_apps": [],
"extra": {},
"email": "invited_user@juiceanalytics.com",
"key": "0626d808767dc0abc76a4266ad2df687b3008156",
"date_invited": "2016-06-01T18:24:04.358609Z",
"invitation_email_count": 1
},
]
Response JSON Object: | |
---|---|
|
|
Request Headers: | |
|
|
Response Headers: | |
|
|
Status Codes: |
|
POST
/api/v1/jb/users/invitations/
¶Invite a User
Example Request:
POST /api/v1/jb/users/invitations/
Accept: application/json
Authorization: Token 7297b3ebb0e7f7baf5f54d39908dda99f5ea8665
{
"email": "new_user@juiceanalytics.com",
"client": 1,
"extra": {},
"initial_apps": [
"zylTKNVx",
],
"is_demo_user": "true"
}
Example Response:
HTTP/1.1 200 OK
Vary: Accept
Content-Type: text/javascript
{
"id": 4,
"user": {
"extra": {},
"last_login": null,
"email": "jason@juice.com",
"handle": "@jason",
"first_name": "",
"last_name": "",
"is_active": true,
"date_joined": "2016-06-01T18:13:17.943920Z",
"is_demo_user": false,
"profile_color": "ff0000",
"profile_avatar": "https://fruition-snapshots.s3.amazonaws.com/avatars/profile-defaults/default.png",
"last_activated": "2016-06-01T18:13:17.943951Z",
"last_deactivated": null,
"apps": []
},
"initial_apps": ["zylTKNVx",],
"extra": {},
"email": "new_user@juiceanalytics.com",
"key": "0626d808767dc0abc76a4266ad2df687b3008156",
"date_invited": "2016-06-01T18:24:04.358609Z",
"invitation_email_count": 1,
"is_demo_user": "true"
},
Request JSON Object: | |
---|---|
|
|
Response JSON Object: | |
|
|
Request Headers: | |
|
|
Response Headers: | |
|
|
Status Codes: |
|
POST
/api/v1/jb/users/invitations/
¶Invite a list of Users
Example Request:
POST /api/v1/jb/users/invitations/
Accept: application/json
Authorization: Token 7297b3ebb0e7f7baf5f54d39908dda99f5ea8665
[{
"email": "new_user@juiceanalytics.com",
"client": 1,
"extra": {},
"initial_apps": [
"zylTKNVx",
],
"is_demo_user": "true"
},
{
"email": "new_user2@juiceanalytics.com",
"client": 1,
"extra": {},
"initial_apps": [
"hsYD763",
],
"is_demo_user": "true"
},
{
"email": "new_user3@juiceanalytics.com",
"client": 1,
"extra": {},
"initial_apps": [
"sMfh63S",
],
"is_demo_user": "true"
}]
Example Response:
HTTP/1.1 200 OK
Vary: Accept
Content-Type: text/javascript
[{
"id": 4,
"user": {
"extra": {},
"last_login": null,
"email": "jason@juice.com",
"handle": "@jason",
"first_name": "",
"last_name": "",
"is_active": true,
"date_joined": "2016-06-01T18:13:17.943920Z",
"is_demo_user": false,
"profile_color": "ff0000",
"profile_avatar": "https://fruition-snapshots.s3.amazonaws.com/avatars/profile-defaults/default.png",
"last_activated": "2016-06-01T18:13:17.943951Z",
"last_deactivated": null,
"apps": []
},
"initial_apps": ["zylTKNVx",],
"extra": {},
"email": "new_user@juiceanalytics.com",
"key": "0626d808767dc0abc76a4266ad2df687b3008156",
"date_invited": "2016-06-01T18:24:04.358609Z",
"invitation_email_count": 1,
"is_demo_user": "true"
},
{
"id": 4,
"user": {
"extra": {},
"last_login": null,
"email": "jason@juice.com",
"handle": "@jason",
"first_name": "",
"last_name": "",
"is_active": true,
"date_joined": "2016-06-01T18:13:17.943920Z",
"is_demo_user": false,
"profile_color": "ff0000",
"profile_avatar": "https://fruition-snapshots.s3.amazonaws.com/avatars/profile-defaults/default.png",
"last_activated": "2016-06-01T18:13:17.943951Z",
"last_deactivated": null,
"apps": []
},
"initial_apps": ["hsYD763",],
"extra": {},
"email": "new_user2@juiceanalytics.com",
"key": "0626fd8fds78f87dsa4266adfdsfsdfsd7b3008156",
"date_invited": "2016-06-01T18:24:04.358609Z",
"invitation_email_count": 1,
"is_demo_user": "true"
},
{
"id": 4,
"user": {
"extra": {},
"last_login": null,
"email": "jason@juice.com",
"handle": "@jason",
"first_name": "",
"last_name": "",
"is_active": true,
"date_joined": "2016-06-01T18:13:17.943920Z",
"is_demo_user": false,
"profile_color": "ff0000",
"profile_avatar": "https://fruition-snapshots.s3.amazonaws.com/avatars/profile-defaults/default.png",
"last_activated": "2016-06-01T18:13:17.943951Z",
"last_deactivated": null,
"apps": []
},
"initial_apps": ["sMfh63S",],
"extra": {},
"email": "new_user3@juiceanalytics.com",
"key": "0626d88sjdgwte63HDFS7266ad2df687b3008156",
"date_invited": "2016-06-01T18:24:04.358609Z",
"invitation_email_count": 1,
"is_demo_user": "true"
}]
Request JSON Object: | |
---|---|
|
|
Response JSON Object: | |
|
|
Request Headers: | |
|
|
Response Headers: | |
|
|
Status Codes: |
|
PATCH
/api/v1/jb/users/invitations/new_user@juiceanalytics.com/
¶Change an invited user’s initial apps
Example Request:
PATCH /api/v1/jb/users/invitations/new_user@juiceanalytics.com/
Accept: application/json
Authorization: Token 7297b3ebb0e7f7baf5f54d39908dda99f5ea8665
{
"initial_apps": [
"KNVxzylT"
]
}
Example Response:
HTTP/1.1 200 OK
Vary: Accept
Content-Type: text/javascript
{
"id": 4,
"user": {
"extra": {},
"last_login": null,
"email": "jason@juice.com",
"handle": "@jason",
"first_name": "",
"last_name": "",
"is_active": true,
"date_joined": "2016-06-01T18:13:17.943920Z",
"is_demo_user": false,
"profile_color": "ff0000",
"profile_avatar": "https://fruition-snapshots.s3.amazonaws.com/avatars/profile-defaults/default.png",
"last_activated": "2016-06-01T18:13:17.943951Z",
"last_deactivated": null,
"apps": []
},
"initial_apps": ["KNVxzylT"],
"extra": {},
"email": "new_user@juiceanalytics.com",
"key": "0626d808767dc0abc76a4266ad2df687b3008156",
"date_invited": "2016-06-01T18:24:04.358609Z",
"invitation_email_count": 1
},
Request JSON Object: | |
---|---|
|
|
Response JSON Object: | |
|
|
Request Headers: | |
|
|
Response Headers: | |
|
|
Status Codes: |
|
GET
/api/v1/jb/users/{email}/usage/{app_id}/
¶View a users usage for an app
Example Request:
GET /api/v1/jb/users/user@juiceanalytics.com/usage/9f01c600/
Accept: application/json
Authorization: Token 7297b3ebb0e7f7baf5f54d39908dda99f5ea8665
{}
Example Response:
HTTP/1.1 200 OK
Vary: Accept
Content-Type: text/javascript
{
"action_description": "Viewed Dashboard stack for TDOE ePlan",
"email": "user@juiceanalytics.com",
"full_name": "Christian Oliver",
"timestamp": "2018-07-24T18:29:48.111374Z",
"action": "STACK_ACCESS",
"extra": {
"app": "TDOE ePlan",
"request": {
"path": "/tdoe_eplan/dashboard",
"session": "ylxgp8feaxc5vyor65ab5cs26zz8fsxx",
"META": {
"HTTP_USER_AGENT": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36",
"SERVER_NAME": "31ca45546fe6",
"HTTP_REFERER": "http://localhost:8000/",
"REMOTE_ADDR": "172.20.0.1",
"CONTENT_TYPE": "text/plain",
"REQUEST_METHOD": "GET",
"HTTP_HOST": "localhost:8000",
"SERVER_PORT": "8000",
"QUERY_STRING": "",
"HTTP_ACCEPT_ENCODING": "gzip, deflate, br"
}
},
"stack": "Dashboard",
"app_id": "9f01c600"
}
}