Everabyte API
    Everabyte API
    • Back to home
    • File
    • List
      GET
    • Detail
      GET
    • Upload
      PUT
    • Update
      PUT
    • Download
      GET
    • Delete
      DELETE
    • Public Download
      GET
    • Share file with user
      PUT

      Share file with user

      Prod
      https://api.everabyte.io/api
      Prod
      https://api.everabyte.io/api
      PUT
      https://api.everabyte.io/api
      /files/shared/ad51e53icgvwbgbk2a9ptemf/abe66xi76xox7jb7qxjnb7pw
      This endpoint is used to update the sharing permissions for a specific file for a particular user.
      Endpoint: /files/shared/{fileId}/{userId}
      Method: PUT
      Path Parameters:
      fileId (required): The ID of the file for which the sharing permissions are being updated. Example: ad51e53icgvwbgbk2a9ptemf
      userId (required): The ID of the user for whom the sharing permissions are being updated. Example: abe66xi76xox7jb7qxjnb7pw
      Multiple user IDs can be provided as a comma-separated list. Example: user1,user2,user3
      Request Body Parameters:
      {
        "canView": true,
        "canDownload": true,
        "canEdit": false,
        "createOrUpdate": true
      }
      canView (optional, boolean, default: true): Allows the user to view the file.
      canDownload (optional, boolean, default: true): Allows the user to download the file.
      canEdit (optional, boolean, default: false): Allows the user to edit the file.
      createOrUpdate (optional, boolean, default: true): Creates new permissions if they don't exist, or updates existing ones.
      Example Request (Single User):
      PUT /files/shared/ad51e53icgvwbgbk2a9ptemf/abe66xi76xox7jb7qxjnb7pw
      Content-Type: application/json
      
      {
        "canView": true,
        "canDownload": false
      }
      This request allows user abe66xi76xox7jb7qxjnb7pw to view file ad51e53icgvwbgbk2a9ptemf, but not download it. canEdit and createOrUpdate default to true.
      Example Request (Multiple Users):
      PUT 
      /files/shared/ad51e53icgvwbgbk2a9ptemf/user1,user2,user3
      Content-Type: application/json
      
      {
        "canView": true
      }
      This request allows users user1, user2, and user3 to view file ad51e53icgvwbgbk2a9ptemf. canDownload, canEdit, and createOrUpdate default to true.
      Response Codes:
      200 OK: Permissions successfully updated.
      201 Created: Permissions successfully created.
      400 Bad Request: Invalid request parameters or body.
      404 Not Found: File or user not found.
      500 Internal Server Error: Server error.

      Request

      Authorization
      Provide your bearer token in the
      Authorization
      header when making requests to protected resources.
      Example:
      Authorization: Bearer ********************
      Body Params application/json
      canView
      boolean 
      optional
      canDownload
      boolean 
      optional
      canEdit
      boolean 
      optional
      createOrUpdate
      boolean 
      optional
      Example
      {
        "canView": true,
        "canDownload": true,
        "canEdit": false,
        "createOrUpdate": true
      }

      Request samples

      Shell
      JavaScript
      Java
      Swift
      Go
      PHP
      Python
      HTTP
      C
      C#
      Objective-C
      Ruby
      OCaml
      Dart
      R
      Request Request Example
      Shell
      JavaScript
      Java
      Swift
      curl --location --request PUT 'https://api.everabyte.io/api/files/shared/ad51e53icgvwbgbk2a9ptemf/abe66xi76xox7jb7qxjnb7pw' \
      --header 'Content-Type: application/json' \
      --data-raw '{
          "canView": true,
          "canDownload": true,
          "canEdit": false,
          "createOrUpdate": true
      }'

      Responses

      🟢200Success
      application/json
      Body
      object {0}
      Example
      {}
      Previous
      Public Download
      Built with