Box Developer Documentation
Latest version

Update Box Skill cards on file

put
https://api.box.com/2.0
/files/:file_id/metadata/global/boxSkillsCards

Updates one or more Box Skills metadata cards to a file.

Request

bearer [ACCESS_TOKEN]
application/json-patch+json

Path Parameters

stringin pathrequired
12345

The unique identifier that represents a file.

The ID for any file can be determined by visiting a file in the web application and copying the ID from the URL. For example, for the URL https://*.app.box.com/files/123 the file_id is 123.

Request Body

object arrayin bodyrequired

A JSON-Patch specification for the changes to make to the metadata template.

The changes are represented as a JSON array of operation objects.

stringin bodyoptional
"replace"

replace

Value is always replace

stringin bodyoptional
"/cards/0"

The JSON Path that represents the card to replace. In most cases this will be in the format /cards/{index} where index is the zero-indexed position of the card in the list of cards.

The card to insert into the list of cards at the position defined by path.

Response

Returns the updated metadata template, with the custom template data included.

application/jsonClient error

The requested file could not be found

application/jsonClient error

An unexpected client error.

put
Update Box Skill cards on file
You can now try out some of our APIs live, right here in the documentation.
Log in

Request Example

cURL
curl -i -X PUT "https://api.box.com/2.0/files/12345/metadata/global/boxSkillsCards" \
     -H "authorization: Bearer <ACCESS_TOKEN>" \
     -H "content-type: application/json-patch+json" \
     -d '[
       "op": "replace",
       "path": "/cards/0",
       "value": {
         "type": "skill_card",
         "skill_card_type": "keyword",
         "skill_card_title": {
           "code": "license-plates",
           "message": "Licence Plates"
         },
         "skill": {
           "type": "service"
           "id": "license-plates-service"
         },
         "invocation": {
           "type": "skill_invocation"
           "id": "license-plates-service-123"
         },
         "entries": {
           { "text": "DD-26-YT" },
           { "text": "DN86 BOX" }
         }
       }
     ]'
TypeScript Gen
await client.skills.updateBoxSkillCardsOnFile(file.id, [
  {
    op: 'replace' as UpdateBoxSkillCardsOnFileRequestBodyOpField,
    path: '/cards/0',
    value: new KeywordSkillCard({
      type: 'skill_card' as KeywordSkillCardTypeField,
      skillCardType: 'keyword' as KeywordSkillCardSkillCardTypeField,
      skillCardTitle: {
        code: 'license-plates',
        message: updatedTitleMessage,
      } satisfies KeywordSkillCardSkillCardTitleField,
      skill: new KeywordSkillCardSkillField({
        id: skillId,
        type: 'service' as KeywordSkillCardSkillTypeField,
      }),
      invocation: new KeywordSkillCardInvocationField({
        id: invocationId,
        type: 'skill_invocation' as KeywordSkillCardInvocationTypeField,
      }),
      entries: [{ text: 'DN86 BOX' } satisfies KeywordSkillCardEntriesField],
    }),
  } satisfies UpdateBoxSkillCardsOnFileRequestBody,
]);
Python Gen
client.skills.update_box_skill_cards_on_file(
    file.id,
    [
        UpdateBoxSkillCardsOnFileRequestBody(
            op=UpdateBoxSkillCardsOnFileRequestBodyOpField.REPLACE,
            path="/cards/0",
            value=KeywordSkillCard(
                type=KeywordSkillCardTypeField.SKILL_CARD,
                skill_card_type=KeywordSkillCardSkillCardTypeField.KEYWORD,
                skill_card_title=KeywordSkillCardSkillCardTitleField(
                    code="license-plates", message=updated_title_message
                ),
                skill=KeywordSkillCardSkillField(
                    id=skill_id, type=KeywordSkillCardSkillTypeField.SERVICE
                ),
                invocation=KeywordSkillCardInvocationField(
                    id=invocation_id,
                    type=KeywordSkillCardInvocationTypeField.SKILL_INVOCATION,
                ),
                entries=[KeywordSkillCardEntriesField(text="DN86 BOX")],
            ),
        )
    ],
)

Response Example

{
  "$canEdit": true,
  "$id": "01234500-12f1-1234-aa12-b1d234cb567e",
  "$parent": "folder_59449484661,",
  "$scope": "enterprise_27335",
  "$template": "properties",
  "$type": "properties-6bcba49f-ca6d-4d2a-a758-57fe6edf44d0",
  "$typeVersion": 2,
  "$version": 1,
  "cards": [
    {
      "created_at": "2018-04-13T13:53:23-07:00",
      "entries": [
        {
          "text": "keyword1"
        }
      ],
      "invocation": {
        "id": "image-recognition-service-123",
        "type": "skill_invocation"
      },
      "skill": {
        "id": "image-recognition-service",
        "type": "service"
      },
      "skill_card_title": {
        "code": "labels",
        "message": "Labels"
      },
      "skill_card_type": "keyword",
      "type": "skill_card"
    }
  ]
}