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 Clients endpoints provide a way to view clients and their sites, users, apps and invitations.
GET
/api/v1/jb/clients/
¶Get a list of clients
Example Request:
GET /api/v1/jb/clients/
Accept: application/json
Authorization: Token 7297b3ebb0e7f7baf5f54d39908dda99f5ea8665
Example Response:
HTTP/1.1 200 OK
Vary: Accept
Content-Type: text/javascript
[
{
"id": 1,
"site": {
"domain": "localhost:8000",
"formatted_name": "localhost"
},
"name": "Juicebox",
"default_from_email": "",
"invitation_subject": "",
"invitation_body": "",
"login_title": "Welcome to Juicebox",
"login_subtitle": "",
"support_email": "support@juiceanalytics.com",
"home_location": "/",
"subtitle_404": "Oops, the application you're looking for does not exist.",
"message_404": "You may want to head back to the homepage.<br />If you think something is broken, report a problem.",
"subtitle_500": "Looks like we're having some server issues.",
"message_500": "Go back to the previous page and try again. If you think something is broken, report a problem.",
"password_min_length": 8,
"password_allow_common": false,
"password_require_numeric": false,
"password_require_upper": false,
"password_require_lower": false,
"password_require_special": false,
"password_expiration_days": 0
}
]
Response JSON Array of Objects: | |
---|---|
|
|
Request Headers: | |
|
|
Response Headers: | |
|
|
Status Codes: |
|
GET
/api/v1/jb/clients/
(int: id)/
¶Get details for a client
Example Request:
GET /api/v1/jb/clients/1/
Accept: application/json
Authorization: Token 7297b3ebb0e7f7baf5f54d39908dda99f5ea8665
Example Response:
HTTP/1.1 200 OK
Vary: Accept
Content-Type: text/javascript
{
"id": 1,
"site": {
"domain": "localhost:8000",
"formatted_name": "localhost"
},
"name": "Juicebox",
"default_from_email": "",
"invitation_subject": "",
"invitation_body": "",
"login_title": "Welcome to Juicebox",
"login_subtitle": "",
"support_email": "support@juiceanalytics.com",
"home_location": "/",
"subtitle_404": "Oops, the application you're looking for does not exist.",
"message_404": "You may want to head back to the homepage.<br />If you think something is broken, report a problem.",
"subtitle_500": "Looks like we're having some server issues.",
"message_500": "Go back to the previous page and try again. If you think something is broken, report a problem.",
"password_min_length": 8,
"password_allow_common": false,
"password_require_numeric": false,
"password_require_upper": false,
"password_require_lower": false,
"password_require_special": false,
"password_expiration_days": 0
}
Parameters: |
|
---|---|
Response JSON Object: | |
|
|
Request Headers: | |
|
|
Response Headers: | |
|
|
Status Codes: |
|
PATCH
/api/v1/jb/clients/
(int: id)/
¶Update details for a client
Example Request:
PATCH /api/v1/jb/clients/1/
Accept: application/json
Authorization: Token 7297b3ebb0e7f7baf5f54d39908dda99f5ea8665
{
"name": "My Client Name"
}
Example Response:
HTTP/1.1 200 OK
Vary: Accept
Content-Type: text/javascript
{
"id": 1,
"site": {
"domain": "localhost:8000",
"formatted_name": "localhost"
},
"name": "My Client Name",
"default_from_email": "",
"invitation_subject": "",
"invitation_body": "",
"login_title": "Welcome to Juicebox",
"login_subtitle": "",
"support_email": "support@juiceanalytics.com",
"home_location": "/",
"subtitle_404": "Oops, the application you're looking for does not exist.",
"message_404": "You may want to head back to the homepage.<br />If you think something is broken, report a problem.",
"subtitle_500": "Looks like we're having some server issues.",
"message_500": "Go back to the previous page and try again. If you think something is broken, report a problem."
"password_min_length": 8,
"password_allow_common": false,
"password_require_numeric": false,
"password_require_upper": false,
"password_require_lower": false,
"password_require_special": false,
"password_expiration_days": 0
}
Parameters: |
|
---|---|
Request JSON Object: | |
|
|
Response JSON Object: | |
|
|
Request Headers: | |
|
|
Response Headers: | |
|
|
Status Codes: |
|
GET
/api/v1/jb/clients/
(int: id)/site/
¶Get site details for a client
Example Request:
GET /api/v1/jb/clients/1/site/
Accept: application/json
Authorization: Token 7297b3ebb0e7f7baf5f54d39908dda99f5ea8665
Example Response:
HTTP/1.1 200 OK
Vary: Accept
Content-Type: text/javascript
{
"id": 2,
"domain": "localhost:8000",
"name": "localhost:8000"
}
Parameters: |
|
---|---|
Response JSON Object: | |
|
|
Request Headers: | |
|
|
Response Headers: | |
|
|
Status Codes: |
|
GET
/api/v1/jb/clients/
(int: id)/users/
¶Get a details for a client
Example Request:
GET /api/v1/jb/clients/1/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,
"last_password_set": "2016-06-01T13:22:24.439209Z",
"apps": [
"zylTKNVx"
]
}
]
Parameters: |
|
---|---|
Response JSON Object: | |
|
|
Request Headers: | |
|
|
Response Headers: | |
|
|
Status Codes: |
|
GET
/api/v1/jb/clients/
(int: id)/users/invitations/
¶Get a list of pending invited users
Example Request:
GET /api/v1/jb/clients/1/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
},
]
Parameters: |
|
---|---|
Response JSON Object: | |
|
|
Request Headers: | |
|
|
Response Headers: | |
|
|
Status Codes: |
|
POST
/api/v1/jb/clients/
(int: id)/users/invitations/
¶Get a list of pending invited users
Example Request:
POST /api/v1/jb/clients/1/users/invitations/
Accept: application/json
Authorization: Token 7297b3ebb0e7f7baf5f54d39908dda99f5ea8665
{
"email": "new_user@juiceanalytics.com",
"extra": {},
"initial_apps": [
"zylTKNVx"
]
}
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
},
Parameters: |
|
---|---|
Request JSON Object: | |
|
|
Response JSON Object: | |
|
|
Request Headers: | |
|
|
Response Headers: | |
|
|
Status Codes: |
|
GET
/api/v1/jb/clients/
(int: id)/apps/
¶Get a list of apps for a client
Example Request:
GET /api/v1/jb/clients/1/apps/
Accept: application/json
Authorization: Token 7297b3ebb0e7f7baf5f54d39908dda99f5ea8665
Example Response:
HTTP/1.1 200 OK
Vary: Accept
Content-Type: text/javascript
[
{
"id": "zylTKNVx",
"slug": "datademo",
"label": "Data Services Demo",
"show_help": false,
"help_html": "\n",
"show_footer": false,
"footer_html": "",
"description": "US Census Bureau data services demo"
}
]
Parameters: |
|
---|---|
Response JSON Object: | |
|
|
Request Headers: | |
|
|
Response Headers: | |
|
|
Status Codes: |
|