Skip to content

Document Hub Put

Request
Description Generates a URL for uploading a file to a specified path.
Context https://<instance>.optimizemyday.com/document-service/rs/v1/documents
URL /put
Method GET
Response Code 200 when successful, another HTTP status code otherwise
Success Response the upload URL.
Response Type text/plain
Parameter Datatype Description
configId Integer The identifier of the configuration.
path String The folder path of the file.
name String The name of the file.

Sample Call

https://www.optimizemyday.com/document-service/rs/v1/documents/put?configId=16169175&path=tasks%2FA-0000006&name=test1.md

Sample Result

https://your-omd-s3-endpoint.com/tasks/A-0000006/test1.md?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20241205T155020Z&X-Amz-SignedHeaders=host&X-Amz-Expires=59&X-Amz-Credential=AAAABBBB_request&X-Amz-Signature=bbbbAAAA

Sample Upload - Binary File

  1. Request an upload URL for the binary file:
curl -G "https://www.optimizemyday.com/document-service/rs/v1/documents/put" \
    -H "Authorization: Bearer YOUR_CONFIGURATION_TOKEN" \
    --data-urlencode "configId=16169175" \
    --data-urlencode "path=tasks/A-0000006" \
    --data-urlencode "name=service-report.pdf"
  1. Use the returned URL to upload the binary content:
curl -X PUT "https://your-omd-s3-endpoint.com/tasks/A-0000006/service-report.pdf?..." \
    eion/octet-stream" \
    --upload-file ./service-report.pdf

Sample Upload - Image File

  1. Request an upload URL for the image file:
curl -G "https://www.optimizemyday.com/document-service/rs/v1/documents/put" \
    -H "Authorization: Bearer YOUR_CONFIGURATION_TOKEN" \
    --data-urlencode "configId=16169175" \
    --data-urlencode "path=tasks/A-0000006" \
    --data-urlencode "name=photo-before.jpg"
  1. Upload the image using the returned URL:
curl -X PUT "https://your-omd-s3-endpoint.com/tasks/A-0000006/photo-before.jpg?..." \
    -H "Content-Type: image/jpeg" \
    --upload-file ./photo-before.jpg

For PNG images, use Content-Type: image/png.