Skip to content

VCC

Configuration examples

A transformer configuration (using the Photo flip adapter)

Rotates an image by 180 degrees

{
    "configuration_name": "image-rotate-180-degrees",
    "experience_id": "developer-conference-2022",
    "adapter_name": "photo_flip",
    "adapter_config": {
        "adapter_config": {
        "auth": {},
        "defaults": {
            "method": "ROTATE_180"
        }
    }
}

A destination configuration (using the Amazon S3 adapter)

Uploads a file to an S3 bucket

{
    "configuration_name": "image-s3-upload",
    "experience_id": "developer-conference-2022",
    "adapter_name": "s3",
    "adapter_config": {
        "auth": {
            "secret_key": "xxx",
            "access_key": "xxx"
        },
        "defaults": {
            "bucket_name": "abc-conference-uploads",
            "public": true,
            "force_download": false,
            "file_prefix": "xpkit/vcc/",
            "bucket_url": "https://s3.amazonaws.com"
        }
    },
    "activity_config": {
        "experience_id": "developer-conference-2022",
        "activity_type": "content-generation",
        "payload": {
            "object_id": "website"
        }
    }
}

A chained configuration (using the previous two configurations)

Rotates an image by 180 degrees and then uploads it to an S3 bucket

{
    "configuration_name": "image-generation",
    "experience_id": "developer-conference-2022",
    "call_chain": [
        [
            "image-rotate-180-degrees",
            null
        ],
        [
            "image-s3-upload",
            0
        ]
    ],
    "webhook_url": "https://xpkit.abc.com/callback"
}

Task request examples

Create a task (using the chained configuration above)

Rotate and upload an image to S3 and create an activity for the profile with the email address sarah.jones@abc.com

curl --location --request POST 'https://vcc.emea.xpkit.net/api/task/' \
--header 'Authorization: Bearer <redacted>' \
--form 'data=@"/path/to/file/visitor.jpg"' \
--form 'configuration_name="image-generation"' \
--form 'extras="{\"email\": [\"sarah.jones@abc.com\"]}"'

Task Group request examples

This request does the following:

  • Runs a first (transformer) configuration called tg-image-compositor which uses the Image compositor adapter. This takes an image input from tg-image-compositor_data and composites it with HTML supplied in the configuration.
  • Runs a second (transformer) configuration called tg-overlay using the Video add overlay adapter. This takes a video file from tg-overlay_data. It uses the file generated in the previous step as the image to overlay over the video. This is achieved by providing the tg-overlay_extras param.
  • Runs a third (destination) configuration called tg-s3-upload which uses the Amazon S3 adapter. It takes its input from the previous task, specified in the tg-s3-upload_input param and uploads this file to Amazon S3.
  • Once these three tasks are complete the results are posted to the web hook.
curl --location --request POST 'https://vcc.emea.xpkit.net/api/taskgroup/' \
--header 'Authorization: Bearer <redacted>' \
--form 'configuration_names="[\"tg-image-compositor\", \"tg-overlay\", \"tg-s3-upload\"]"' \
--form 'tg-image-compositor_data=@"/path/to/file/MyFile.png"' \
--form 'tg-image-compositor_extras="{\"additional_context\":  {\"voucher_code\": \"AAA-BBB-CCC\"}}"' \
--form 'tg-overlay_extras="{\"overlay_file_name_override\": \"tg-image-compositor\"}"' \
--form 'tg-overlay_data=@"/path/to/file/MyFile.mp4"' \
--form 'tg-s3-upload_input="tg-overlay"' \
--form 'webhook_url="https://xpkit.abc.com/callback"'