2.1.8.2 Calling the API to Upload a File

To call the API:
  1. Open a relevant tool, such as via the 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?stripeName=default' \
    --header 'ofs_remote_user: <remoteuser>’ \
    --header 'locale: en-US' \
    --header 'ofs_tenant_id: <tenant ID>' \
    --header 'ofs_workspace_id: WS001' \
    --header 'ofs_service_id: OFS_FSAFND' \
    --header 'Authorization: Bearer <bearer token> \
    --form 'file<filename with path>'
    Example
    curl --location 'https://devcorp7.ofsaa.us-phoenix-1.ocs.oc-test.com/xds0py-prd/utils-service/v1/file/uploadfile?stripeName=default' \
    --header 'locale: en-US' \
    --header 'ofs_tenant_id: t2kyy-prd' \
    --header 'ofs_workspace_id: WS001' \
    --header 'ofs_service_id: OFS_FSAFND' \
    --header 'Authorization: Bearer eyJ4NXQjUzI1NiI6Il81VDZ3cThFcGFmdWxKWVJXZjFXOWFpdnpHM2tWaG0wMDlpNi01aFFRbGsiLCJ4NXQiOiJzcmRMdzVMNHR
    …
    …
    qSUImp-4eayj1E1h6pnFSMBE_3VzS_reEcKiMS-1uULM2j6YaxfTS2kMYA' \
    --form 'file=@"/C:/OFSS/AAI_Nxg/FileWatcherFiles/Filewatcher_20141231_MAN.txt"'