Files

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

The File object

Properties

  • idstring

    Unique identifier for the object.

  • namestring

    The name of the file.

  • groupFileIdstring

    The group file id if the file is part of a group.

  • outsourcingobject

    Outsourcing
  • sizenumber

    The size of the file in bytes.

  • createdAtdate

    The date and time the entity was created.

File object

{
  "id": "6703d7085d0425373dd52f20",
  "name": "AI5061393.pdf",
  "outsourcing": {
    "shareWithAll": false,
    "sharedWith": []
  },
  "size": 102360,
  "createdAt": "2024-10-07T12:41:44.700Z"
}

GET/v2/jobs/:id/files

List all files

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

Request

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

Response

[
  {
    "id": "6703d7085d0425373dd52f20",
    "name": "AI5061393.pdf",
    "outsourcing": {
      "shareWithAll": false,
      "sharedWith": []
    },
    "size": 102360,
    "createdAt": "2024-10-07T12:41:44.700Z"
  },
  {...},
  {...}
]

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

Upload a file

This endpoint allows you to upload a file. If an outsourcing id is specified, the file will be uploaded to the outsourcing job.

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/jobs/:id/files/upload/:outsourcingId?
curl https://api.lsp.expert/v2/jobs/6548c72a13162e1d7ade0290/files/upload \
  -u {key}: \
  -F file="@/path/to/a/file.jpg"

Response

  {
    "id": "6703d7085d0425373dd52f20",
    "name": "file.jpg",
    "outsourcing": {
      "shareWithAll": false,
      "sharedWith": []
    },
    "size": 102360,
    "createdAt": "2024-10-07T12:41:44.700Z"
  }


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

Download a file

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

Request

GET
/v2/jobs/:id/files/:fileId
curl https://api.lsp.expert/v2/jobs/66f1313f9e477f90664d1ad8/files/6703d7085d0425373dd52f20 \
  -u {key}:

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

Set shared with all outsourcing jobs

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

Parameters

    Request

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

    Response

      {
        "id": "6703d7085d0425373dd52f20",
        "name": "file.jpg",
        "outsourcing": {
          "shareWithAll": true,
          "sharedWith": []
        },
        "size": 102360,
        "createdAt": "2024-10-07T12:41:44.700Z"
      }
    

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

    Unset shared with all outsourcing jobs

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

    Parameters

      Request

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

      Response

       {
        "id": "6703d7085d0425373dd52f20",
        "name": "file.jpg",
        "outsourcing": {
          "shareWithAll": false,
          "sharedWith": []
        },
        "size": 102360,
        "createdAt": "2024-10-07T12:41:44.700Z"
      }
      

      PUT/v2/jobs/:id/files/:fileId/share/with/:outsourcingId

      Set a file as shared with an outsourcing job

      This endpoint allows you to set a file as shared with an outsourcing job.

      Parameters

        Request

        PUT
        /v2/jobs/:id/files/:fileId/share/with/:outsourcingId
        curl -X PUT https://api.lsp.expert/v2/jobs/66f1313f9e477f90664d1ad8/files/6703d7085d0425373dd52f20/share/with/6703d9505d04258be9d537f2 \
          -u {key}: 
        

        Response

          {
            "id": "6703d7085d0425373dd52f20",
            "name": "file.jpg",
            "outsourcing": {
              "shareWithAll": true,
              "sharedWith": ["6703d9505d04258be9d537f2"]
            },
            "size": 102360,
            "createdAt": "2024-10-07T12:41:44.700Z"
          }
        

        DEL/v2/jobs/:id/files/:fileId/share/with/:outsourcingId

        Unset a file as shared with an outsourcing job

        This endpoint allows you to unset a file as shared with an outsourcing job.

        Parameters

          Request

          DEL
          /v2/jobs/:id/files/:fileId/share/with/:outsourcingId
          curl -X DEL https://api.lsp.expert/v2/jobs/66f1313f9e477f90664d1ad8/files/6703d7085d0425373dd52f20/share/with/6703d9505d04258be9d537f2\
            -u {key}: 
          

          Response

           {
            "id": "6703d7085d0425373dd52f20",
            "name": "file.jpg",
            "outsourcing": {
              "shareWithAll": false,
              "sharedWith": []
            },
            "size": 102360,
            "createdAt": "2024-10-07T12:41:44.700Z"
          }
          

          DELETE/v2/jobs/:id/files/:fileId

          Delete a file

          This endpoint allows you to delete a file.

          Request

          DELETE
          /v2/jobs/:id/files/:fileId
          curl -X DELETE https://api.lsp.expert/v2/jobs/:66f1313f9e477f90664d1ad8/files/6703d7085d0425373dd52f20 \
            -u {key}: