Box Developer Documentation

Join BoxWorks 2024 to discover what's possible with content and AI!

Register now!

Update all Box Skill cards on file

put
https://api.box.com/2.0
/skill_invocations/:skill_id

An alternative method that can be used to overwrite and update all Box Skill metadata cards on a file.

Request

bearer [ACCESS_TOKEN]
application/json

Path Parameters

stringin pathrequired
33243242

The ID of the skill to apply this metadata for.

Request Body

objectin body

The file to assign the cards to.

stringin bodyrequired
"3243244"

The ID of the file

stringin bodyrequired
"file"

file

Value is always file

objectin body

The optional file version to assign the cards to.

stringin bodyoptional
"731381601045"

The ID of the file version

stringin bodyoptional
"file_version"

file_version

Value is always file_version

objectin body

The metadata to set for this skill. This is a list of Box Skills cards. These cards will overwrite any existing Box skill cards on the file.

A list of Box Skill cards to apply to this file.

stringin bodyrequired
"success"

Defines the status of this invocation. Set this to success when setting Skill cards.

Value is one of invoked,processing,success,transient_failure,permanent_failure

objectin body

A descriptor that defines what items are affected by this call.

Set this to the default values when setting a card to a success state, and leave it out in most other situations.

stringin bodyoptional
"file"

file

numberin bodyoptional
1

1

Response

none

Returns an empty response when the card has been successfully updated.

application/jsonClient error

Returns an error when the request body is not valid.

  • schema_validation_failed - The request body contains a value for a field that either does not exist, or for which the value or type does not match the expected field type. An example might be an unknown option for an enum or multiSelect field.
application/jsonClient error

Returns an error when the file could not be found or the user does not have access.

  • not_found - The file could not be found, or the user does not have access to the file.
application/jsonClient error

An unexpected client error.

put
Update all 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/skill_invocations/33243242" \
     -H "authorization: Bearer <ACCESS_TOKEN>" \
     -H "content-type: application/json" \
     -d '{
       "status": "success",
       "metadata": {
         "cards": [{
            "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" }
            }
          },{
            "type": "skill_card",
            "skill_card_type": "transcript",
            "skill_card_title": {
              "code": "video-transcription",
              "message": "Video Transcription"
            },
            "skill": {
              "type": "service"
              "id": "video-transcription-service"
            },
            "invocation": {
              "type": "skill_invocation"
              "id": "video-transcription-service-123"
            },
            "duration": 1000,
            "entries": {
              {
                "text": "Hi John, have I told you about Box recently?",
                "appears": [{ "start": 0 }]
              },
              {
                "text": "No Aaron, you have not. Tell me more!",
                "appears": [{ "start": 5 }]
              }
            }
          },{
            "type": "skill_card",
            "skill_card_type": "timeline",
            "skill_card_title": {
              "code": "face-detection",
              "message": "Faces"
            },
            "skill": {
              "type": "service"
              "id": "face-detection-service"
            },
            "invocation": {
              "type": "skill_invocation"
              "id": "face-detection-service-123"
            },
            "duration": 1000,
            "entries": {
              {
                "text": "John",
                "appears": [{ "start": 0, "end": 5 }, { "start": 10, "end": 15 }],
                "image_url": "https://example.com/john.png"
              },
              {
                "text": "Aaron",
                "appears": [{ "start": 5, "end": 10 }],
                "image_url": "https://example.com/aaron.png"
              }
            }
          },{
            "type": "skill_card",
            "skill_card_type": "status",
            "skill_card_title": {
              "code": "hold",
              "message": "Please hold..."
            },
            "skill": {
              "type": "service"
              "id": "face-detection-service"
            },
            "invocation": {
              "type": "skill_invocation"
              "id": "face-detection-service-123"
            },
            "status": {
              "code": "processing",
              "message": "We are processing this file right now."
            }
          }],
       },
       "file": {
         "id": "12345"
       },
       "usage": {
         "unit": "file",
         "value": 1
       }
     }'