Files

Files represent files associated with a group. They can be used to store additional information about a group.

The File object

Properties

  • idstring

    Unique identifier for the object.

  • namestring

    The name of the file.

  • outsourcingobject

    The outsourcing options for the file.
  • sizenumber

    The size of the file in bytes.

  • createdAtdate

    The date and time the entity was created.

File object

{
  "id": "65af6f23014c1c7a227e890f",
  "createdAt": "2024-10-14T12:54:23.617Z",
  "name": "Ref material.pdf",
  "outsourcing": { 
    "shareWithAll": false, 
    "sharedWith": [] 
  },
  "size": 189724
}

GET/v2/groups/:id/files

List all files

This endpoint allows you to retrieve all the files for a group.

Request

GET
/v2/groups/:id/files
curl -G https://api.lsp.expert/v2/groups/6548c72a13162e1d7ade0290/files \
  -u {key}: 

Response

[
  {
    "id": "65af6f23014c1c7a227e890f",
    "createdAt": "2024-10-14T12:54:23.617Z",
    "name": "Ref material.pdf",
    "outsourcing": { 
      "shareWithAll": false, 
      "sharedWith": [] 
    },
    "size": 189724
  },
  {...},
  {...}
]

POST/v2/groups/:id/files/upload/:outsourcingId?

Upload a file

This endpoint allows you to upload a file .

Parameters

  • fileobject

    A file to upload. Make sure that the specifications follow RFC 2388, which defines file transfers for the multipart/form-data protocol.

Request

POST
/v2/groups/:id/files/upload/:outsourcingId?
curl https://api.lsp.expert/v2/groups/6548c72a13162e1d7ade0290/files/upload \
  -u {key}: \
  -F file="@/path/to/a/file.jpg"

Response

{
  "id": "6548c72a13162e1d7ade0291",
  "name": "file.jpg",
  "size": 487477,
  "createdAt": "2024-01-23T07:47:47.440Z",
  "outsourcing": { 
    "shareWithAll": false, 
    "sharedWith": [] 
  }
}


GET/v2/groups/:id/files/:fileId/download

Download a file

This endpoint allows you to download a file for a group.

Request

GET
/v2/groups/:id/files/:fileId
curl https://api.lsp.expert/v2/groups/66f1313f9e477f90664d1ad8/files/6548c72a13162e1d7ade0291 \
  -u {key}:

DELETE/v2/groups/:id/files/:fileId

Delete a file

This endpoint allows you to delete a file.

Request

DELETE
/v2/groups/:id/files/:fileId
curl -X DELETE https://api.lsp.expert/v2/groups/66f1313f9e477f90664d1ad8/files/6548c72a13162e1d7ade0291 \
  -u {key}:

PUT/v2/groups/:id/files/:fileId/share/with/all

Set shared with all outsourcing groups

This endpoint allows you to set a file as shared with all outsourcing groups.

Parameters

    Request

    PUT
    /v2/groups/:id/files/:fileId/share/with/all
    curl -X PUT https://api.lsp.expert/v2/groups/66f1313f9e477f90664d1ad8/files/6548c72a13162e1d7ade0291/share/with/all \
      -u {key}: 
    

    Response

      {
      "id": "6548c72a13162e1d7ade0291",
      "name": "file.jpg",
      "size": 487477,
      "createdAt": "2024-01-23T07:47:47.440Z",
      "outsourcing": { 
        "shareWithAll": true, 
        "sharedWith": [] 
      }
    }
    

    DEL/v2/groups/:id/files/:fileId/share/with/all

    Unset shared with all outsourcing groups

    This endpoint allows you to unset a file as shared with all outsourcing groups.

    Parameters

      Request

      DEL
      /v2/groups/:id/files/:fileId/share/with/all
      curl -X DEL https://api.lsp.expert/v2/groups/66f1313f9e477f90664d1ad8/files/6548c72a13162e1d7ade0291/share/with/all \
        -u {key}: 
      

      Response

       {
        "id": "6548c72a13162e1d7ade0291",
        "name": "file.jpg",
        "size": 487477,
        "createdAt": "2024-01-23T07:47:47.440Z",
        "outsourcing": { 
          "shareWithAll": false, 
          "sharedWith": [] 
        }
      }