Prepare Program Resource File
growsurf_prepare_program_resource_filePrepare a local file as a GrowSurf FILE program resource: validate the filename, MIME type, and base64 bytes, then return the upload ticket and result needed for creation or replacement.
Instructions
Prepare a local file for a FILE Program Resource. Accepts a safe file name, matching supported MIME type, and padded base64 bytes, up to 10 MB. GrowSurf requests a one-time ticket and uploads only to the secure HTTPS destination selected by GrowSurf. Returns the original uploadTicket and uploadResult required for file resource creation or replacement. Altered upload results are not valid. The tool does not accept upload URLs or credentials and never retries an ambiguous upload. Requires GROWSURF_UPLOAD_ALLOWED_ORIGINS on the server; without it, only LINK and TEXT resources are available. Targets campaignId if supplied, otherwise GROWSURF_CAMPAIGN_ID.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fileName | Yes | A safe base name with an allowed extension: jpg/jpeg/png/gif/webp/pdf/csv/zip/doc/docx/xls/xlsx/ppt/pptx. | |
| mimeType | Yes | The supported MIME type matching fileName's extension. | |
| campaignId | No | Target program (campaign) id for this call. Defaults to GROWSURF_CAMPAIGN_ID when omitted. Program IDs also identify newly created programs without restarting the server. | |
| fileBase64 | Yes | Canonical padded base64 file bytes only. Do not include a data-URL prefix or whitespace. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uploadResult | No | The minimal signed upload confirmation. Pass it unchanged to create/update. | |
| uploadTicket | No | The one-time GrowSurf ticket. Pass it unchanged to create/update. |