Skip to content
Start here

Update a Request Asset

client.cloudforceOne.requests.assets.update(stringrequestId, stringassetId, AssetUpdateParams { account_id, source } params, RequestOptionsoptions?): AssetUpdateResponse { id, name, created, 2 more }
PUT/accounts/{account_id}/cloudforce-one/requests/{request_id}/asset/{asset_id}

Updates an asset in a Cloudforce One intelligence request.

Security

API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
Cloudforce One Write
ParametersExpand Collapse
requestId: string

UUID.

maxLength36
assetId: string

UUID.

maxLength36
params: AssetUpdateParams { account_id, source }
account_id: string

Path param: Identifier.

maxLength32
source?: string

Body param: Asset file to upload.

ReturnsExpand Collapse
AssetUpdateResponse { id, name, created, 2 more }
id: number

Asset ID.

name: string

Asset name.

created?: string

Defines the asset creation time.

formatdate-time
description?: string

Asset description.

file_type?: string

Asset file type.

Update a Request Asset

import Cloudflare from 'cloudflare';

const client = new Cloudflare({
  apiEmail: process.env['CLOUDFLARE_EMAIL'], // This is the default and can be omitted
  apiKey: process.env['CLOUDFLARE_API_KEY'], // This is the default and can be omitted
});

const asset = await client.cloudforceOne.requests.assets.update(
  'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
  'f174e90a-fafe-4643-bbbc-4a0ed4fc8415',
  { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
);

console.log(asset.id);
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": {
    "id": 0,
    "name": "example.docx",
    "created": "2022-01-01T00:00:00Z",
    "description": "example description",
    "file_type": "docx"
  }
}
Returns Examples
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": {
    "id": 0,
    "name": "example.docx",
    "created": "2022-01-01T00:00:00Z",
    "description": "example description",
    "file_type": "docx"
  }
}