This page includes the Users and Local Users endpoints.


Users

/system/users

This endpoint allows you to manage users in Shares.

Request Headers

Content-Type: application/json
Accept: application/json
Authorization: Bearer access_token
Host: example.org
Cookie: 

Request Example

curl "http://shares.example.com/system/users" -d '{"active":true,"first_name":"Hermione","last_name":"Granger","email":"hermione@hogwarts.edu","expires_at":null}' -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer access_token" \
-H "Host: example.org" \
-H "Cookie: "

Request Parameters (POST and PUT)

Name Required/Optional Type Description
active Optional boolean Active
first_name Optional string First name
last_name Optional string Last name
email Required string Email address
expires_at Optional dateTime Account expires at

Success Response Codes

  • 200 OK
  • 201 Created

Error Response Codes

  • 422 Unprocessable Entity

Response Attributes

Name Type Description
active boolean active
name string User name
first_name string First name. Only required if last_name is empty.
last_name string Last name. Only required if first_name is empty.
email string Email address
expires_at dateTime Account expires at (optional)

List all users

GET /system/users

Request Example

curl -g "http://shares.example.com/system/users" -X GET \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer JxiXJGZrCCNcNANJDzx1rTp25ch5ciYwraP5J809ti0" \
-H "Host: example.org" \
-H "Cookie: "

Response Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Content-Security-Policy: script-src 'self' 'unsafe-inline' 'unsafe-eval' https://local.connectme.us https://d3gcli72yxqn2z.cloudfront.net http://d3gcli72yxqn2z.cloudfront.net
Content-Type: application/json; charset=utf-8
Link: 
X-Pagination: {"total_count":2,"total_pages":1,"first_page":true,"last_page":true,"previous_page":null,"next_page":null}
ETag: W/"128e37534195767eba033a6c26ab5e59"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 3e6a318b-308f-4270-8b2b-2c7fc43ff0f4
X-Runtime: 0.016976
Content-Length: 314

Success Response Example

200 OK
[
{
"id": 891963376,
"name": "First_name_29 Last_name_29",
"first_name": "First_name_29",
"last_name": "Last_name_29",
"email": "email_29@example.com",
"active": true
},
{
"id": 227792459,
"name": "Mad Hatter",
"first_name": "Mad",
"last_name": "Hatter",
"email": "madhatter@example.com",
"active": true,
"expires_at": "2017-11-02T19:19:04Z"
}
]


Get a specific user

GET /system/users/{id}

Request Example

curl -g "http://shares.example.com/system/users/227792459" -X GET

Response Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Content-Security-Policy: script-src 'self' 'unsafe-inline' 'unsafe-eval' https://local.connectme.us https://d3gcli72yxqn2z.cloudfront.net http://d3gcli72yxqn2z.cloudfront.net
Content-Type: application/json; charset=utf-8
ETag: W/"d04519119d94d9ee7e60574667215919"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 39d76767-53a4-4e0d-9555-a7928a5aa9fc
X-Runtime: 0.010287
Content-Length: 159

Success Response Example

200 OK
{
"id": 227792459,
"active": false,
"name": "Mad Hatter",
"first_name": "Mad",
"last_name": "Hatter",
"email": "madhatter@example.com",
"expires_at": "2017-11-02T19:19:04Z"
}


Create new user

POST /system/users

Request Example

curl "http://shares.example.com/system/users" -d '{"active":true,"first_name":"Hermione","last_name":"Granger","email":"hermione@hogwarts.edu","expires_at":null}' -X POST \
	-H "Content-Type: application/json" \
	-H "Accept: application/json" \
	-H "Authorization: Bearer JxiXJGZrCCNcNANJDzx1rTp25ch5ciYwraP5J809ti0" \
	-H "Host: example.org" \
	-H "Cookie: "

Response Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Content-Security-Policy: script-src 'self' 'unsafe-inline' 'unsafe-eval' https://local.connectme.us https://d3gcli72yxqn2z.cloudfront.net http://d3gcli72yxqn2z.cloudfront.net
Content-Type: application/json; charset=utf-8
ETag: W/"d47bac9ef454e59ea7c7aef407d7a99a"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 3ee24aab-841a-4b17-98cb-800f8c163e0c
X-Runtime: 0.057873
Content-Length: 152

Success Response Example

201 Created
{
  "id": 891963377,
  "active": true,
  "name": "Hermione Granger",
  "first_name": "Hermione",
  "last_name": "Granger",
  "email": "hermione@hogwarts.edu",
  "expires_at": null
}

Error Response Example

422 Unprocessable Entity
{
  "errors": {
    "email": [
      "is invalid"
    ]
  }
}


Update a user

PUT /system/users/{id}

Request Example

curl "http://shares.example.com/system/users/227792459" -d '{"active":false,"first_name":"Hermione","last_name":"Granger","email":"hermione@hogwarts.edu","expires_at":"2017-11-02T19:19:01.546Z"}' -X PUT

Response Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Content-Security-Policy: script-src 'self' 'unsafe-inline' 'unsafe-eval' https://local.connectme.us https://d3gcli72yxqn2z.cloudfront.net http://d3gcli72yxqn2z.cloudfront.net
Content-Type: application/json; charset=utf-8
ETag: W/"1bf20a6552dc25bff1c9193d38cc4fe2"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: c0a639a1-e812-43e0-8e4d-25c739e64f77
X-Runtime: 0.020400
Content-Length: 171

Success Response Example

200 OK
{
  "id": 227792459,
  "active": false,
  "name": "Hermione Granger",
  "first_name": "Hermione",
  "last_name": "Granger",
  "email": "hermione@hogwarts.edu",
  "expires_at": "2017-11-02T19:19:01Z"
}

Error Response Example

422 Unprocessable Entity
{
   "errors": {
   "email": [
      "is invalid"
      ]
   }
}


Delete a user

DELETE /system/users/{id}

Request Example

curl "http://shares.example.com/system/users/227792459" -d '' -X DELETE

Response Headers

X-Frame-Options: SAMEORIGIN
  X-XSS-Protection: 1; mode=block
  X-Content-Type-Options: nosniff
  Content-Security-Policy: script-src 'self' 'unsafe-inline' 'unsafe-eval' https://local.connectme.us https://d3gcli72yxqn2z.cloudfront.net http://d3gcli72yxqn2z.cloudfront.net
  Cache-Control: no-cache
  X-Request-Id: 2f677eba-9d95-4f62-938b-71d0f2d303df
  X-Runtime: 0.077589

Success Response Example

204 No Content


Local User Endpoint

/system/users/{user_id}/local_user

This endpoint allows you to manage local users.

Set or change a user's password

PUT /system/users/{user_id}/local_user

Request Headers

Content-Type: application/json
Accept: application/json
Authorization: Bearer access_token
Host: example.org
Cookie: 

Request Example

curl "http://shares.example.com/system/users/227792459/local_user" -d '{"password":"Password123_"}' -X PUT \
	-H "Content-Type: application/json" \
	-H "Accept: application/json" \
	-H "Authorization: Bearer access_token" \
	-H "Host: example.org" \
	-H "Cookie: "

Request Parameters

Name Required/Optional Type Description
password Required string Password

Response Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Content-Security-Policy: script-src 'self' 'unsafe-inline' 'unsafe-eval' https://local.connectme.us https://d3gcli72yxqn2z.cloudfront.net http://d3gcli72yxqn2z.cloudfront.net
Content-Type: application/json; charset=utf-8
ETag: W/"5ebe6bb4ebcb208361fc8da708adac12"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: db941fdb-f60b-485a-a2fc-d6addd958f51
X-Runtime: 0.033911
Content-Length: 9

Success Response Example

200 OK
{
  "id": 16
}

Error Response Example

422 Unprocessable Entity
{
   "errors": {
   "password": [
      "must include at least one letter, one number, and one symbol"
      ]
   }
}

Request body for above error response example:

{"password":"notsecure"}

Response Attributes

Name Type Description
id integer User ID
Video player

Video

×