5.1.2 Calling the API to Generate the URL

To call the API, follow these steps:
  1. Open a relevant tool, such as via cURL command.
  2. Prepare a cURL command with the authentication token and other details. For more information refer to the following code.

    Syntax

    curl -k --location --request POST 'https://<hostname>/<TENANT-ID>/utils-service/v1/file/uploadfile/parURL?prefix=' \
    --data-raw '{"fileName": "<remote filename>", "fileSize": <file size>, "mimeType": "<file type>"}' \
    --header 'ofs_remote_user: <USERID>' \
    --header 'locale: en-US' \
    --header 'ofs_tenant_id: <TENANT-ID>' \
    --header 'ofs_workspace_id: WS001' \
    --header 'content-type: application/json' \
    --header 'Authorization: Bearer <TOKEN>'
    Example (truncated)
    curl -k --location --request POST 'https://<hostname>/<TENANT-ID>/utils-service/v1/file/uploadfile/parURL?prefix=' \
    --data-raw '{"fileName": "idcs_log1.txt", "fileSize": 100, "mimeType": "text/plain"}' \
    --header 'ofs_remote_user: cneadmin' \
    --header 'locale: en-US' \
    --header 'ofs_tenant_id: aaitestdev1001-prd' \
    --header 'ofs_workspace_id: WS001' \
    --header 'content-type: application/json' \
    --header 'Authorization: Bearer eyJ4NXQjUzI1NiI6Ildia25rQUR5TUZIMlhlQ1pKcTY1c3o4VzdEVWhKa0s4MldYY0hadk4wWkkiLCJ4
    ...
    ...
    sQXj0iohsSIEmQXVwwjhhqnc4eJNnmCjx8Tb7TXjx1MIQLeOIcfrIj5gkzoMKX94_7USxHv-6LhBzw'