Link support files
To create a link between a parent file and a support file, the parentId attribute must be set to the ID of the parent file, and the parentType attribute must be set to FILE.
Support files can be linked during upload operation or after the upload operation.
- On upload - Upload operation supports linking a support file to a parent file.
- After upload - Use the PATCH file API or the POST link API.
Limitations
Section titled “Limitations”- A parent file can have a maximum of 10 support file links.
Prerequisites
Section titled “Prerequisites”- A main file should be created. To know more about create a file refer here
Link on upload
Section titled “Link on upload”1. Create a new support file upload
Section titled “1. Create a new support file upload”Request
Section titled “Request”POST {baseUrl}/spaces/{spaceId}/uploads-
HEADER:
- Authorization:
Bearer {tid token}
- Authorization:
-
BODY:
name- Name of fileparentId- Parent id for the file where it needs to be createdparentType- Should be FILE for support filessupportFileKey- Key to link the support file to the parent fileparentMajorVersion- Major version of the parent file to link the support file to a specific version of the parent file
Response
Section titled “Response”After the upload operation is completed, the JSON response includes the id value for the file and URLs for file upload.
Link after upload
Section titled “Link after upload”1. Create a new support file upload
Section titled “1. Create a new support file upload”Request
Section titled “Request”POST {baseUrl}/spaces/{spaceId}/uploads-
HEADER:
- Authorization:
Bearer {tid token}
- Authorization:
-
BODY:
name- Name of fileparentId- Parent id for the file where it needs to be createdparentType- FILE or FOLDER. But for the support file upload it should be FILEsupportFileKey- Key to link the support file to the parent fileparentMajorVersion- Major version of the parent file to link the support file to a specific version of the parent file
Response
Section titled “Response”After the upload operation is completed, the JSON response includes the id value for the file and URLs for file upload.
2. Use the PATCH file API
Section titled “2. Use the PATCH file API”Limitation: Only the parent file’s latest version can be linked using this API
Request
Section titled “Request”PATCH {baseUrl}/spaces/{spaceId}/files/{fileId}-
HEADER:
- Authorization:
Bearer {tid token}
- Authorization:
-
BODY:
links- Links object which contains the support file key, support file id and support file versionlinks.<key>- The support file keylinks.<key>.id- The id of the support filelinks.<key>.version- The version of the support file. If not provided, the latest version will be linked
3. Use the POST link API
Section titled “3. Use the POST link API”Parent file’s specific version can be linked using this API. Use the <major_version>.* format as the version ID because support files and links operate only on the main content version.
Request
Section titled “Request”POST {baseUrl}/spaces/{spaceId}/files/{fileId}/versions/{versionId}/link-
HEADER:
- Authorization:
Bearer {tid token}
- Authorization:
-
BODY:
links- Links object which contains the support file key, support file id and support file versionlinks.<key>- The support file keylinks.<key>.id- The id of the support filelinks.<key>.version- The version of the support file. If not provided, the latest version will be linked
To know more about the upload file API refer here.