Shares

/organizations/{organization_id}/projects/{project_id}/settings/shares/

This endpoint allows you to create and manage 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/organizations/32400255/projects/800313582/settings/shares/" -d '{"directory":"/foo/bar","name":"Share","node_id":92268615}' -X POST \
-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
directory Required string Directory path
name Required string Name of share
node_id Required integer ID of node

Success Response Codes

  • 200 OK
  • 201 Created

Error Response Codes

  • 422 Unprocessable Entity

Response Attributes

Name Type Description
id integer ID of share
name string Name of share
root_path string Root path (if applicable)
directory string Directory path
node JSON object Object containing node ID

List all shares

GET /organizations/{organization_id}/projects/{project_id}/settings/shares

Request Example

curl -g "http://shares.example.com/organizations/32400255/projects/800313582/settings/shares" -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
          Link: 
          X-Pagination: {"total_count":1,"total_pages":1,"first_page":true,"last_page":true,"previous_page":null,"next_page":null}
          ETag: W/"e1a5a3365b94ada71a5fb371bf45c440"
          Cache-Control: max-age=0, private, must-revalidate
          X-Request-Id: 7da56b0e-2046-4adc-b839-3f4dc95034dc
          X-Runtime: 0.025746
          Content-Length: 95

Success Response Example

200 OK
[
          {
            "id": 788962653,
            "name": "Share",
            "root_path": "/",
            "directory": "/foo/bar",
            "node": {
              "id": 92268615
            }
          }
          ]


Get specific share

GET /organizations/{organization_id}/projects/{project_id}/shares/{share_id}/settings/share

Request Example

curl -g "http://shares.example.com/organizations/32400255/projects/800313582/shares/788962653/settings/share" -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/"b5516f5c11ed0c9428437f5083118aec"
        Cache-Control: max-age=0, private, must-revalidate
        X-Request-Id: 2409b7d0-2740-483e-ace9-8b33bf021c99
        X-Runtime: 0.028157
        Content-Length: 93

Success Response Example

200 OK
{
        "id": 788962653,
        "name": "Share",
        "root_path": "/",
        "directory": "/foo/bar",
        "node": {
          "id": 92268646
        }
        }


Create new share

POST /organizations/{organization_id}/projects/{project_id}/settings/shares/

Request Example

curl "http://shares.example.com/organizations/32400255/projects/800313582/settings/shares/" -d '{"directory":"/foo/bar","name":"Share","node_id":92268615}' -X POST

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/"3be41a5c1263b0eeaa28b0e91125db72"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 6d043bd3-5d6a-4143-8259-8317f1be67c1
X-Runtime: 0.070167
Content-Length: 77

Success Response Example

201 Created
{
  "id": 788962655,
  "name": "Share",
  "directory": "/foo/bar",
  "node": {
    "id": 92268615
  }
}

Error Response Example

422 Unprocessable Entity
{
          "errors": {
          "node": [
          "must exist"
          ],
          "name": [
          "can't be blank"
          ]
          }
          }

Troubleshooting: The error above is caused by a missing "name" value in the request body:

{"name":""}


Update a share

PUT /organizations/{organization_id}/projects/{project_id}/shares/{share_id}/settings/share

Request Example

curl "http://shares.example.com/organizations/32400255/projects/800313582/shares/788962653/settings/share" -d '{"directory":"/foo/bar","name":"Share2"}' -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/"a7a8f1da252377f34e30fbe2755056f0"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: a0e2012f-6a17-41c9-9c44-3a1827202238
X-Runtime: 0.077092
Content-Length: 94

Success Response Example

200 OK
{
  "id": 788962653,
  "name": "Share2",
  "root_path": "/",
  "directory": "/foo/bar",
  "node": {
    "id": 92268615
  }
}

Error Response Example

422 Unprocessable Entity
{
      "errors": {
        "name": [
          "can't be blank"
        ]
      }
    }


Remove a share

DELETE /organizations/{organization_id}/projects/{project_id}/shares/{share_id}/settings/share

Request Example

curl "http://shares.example.com/organizations/32400255/projects/800313582/shares/788962653/settings/share" -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: ea278294-7258-46cd-8603-0580ac7b1ac3
  X-Runtime: 0.053455

Success Response Example

204 No Content

Video player

Video

×