Portal Community
URL expiry: The url field in the response is a short-lived signed URL that expires approximately 5 minutes after it is issued. Do not cache this URL — call media/download immediately if you need the file content.

When to Use

Configuration

Connection

FieldRequiredDescription
accessTokenRequiredPermanent System User access token from Meta Business Manager. Store in BizFirst Credentials Manager.
phoneNumberIdRequiredNumeric string ID of the WhatsApp Business phone number associated with the media.
apiVersionOptionalMeta Graph API version, e.g. v18.0. Defaults to v18.0.

Operation

FieldRequiredDescription
mediaIdRequiredThe media object ID to look up. Typically sourced from a webhook event payload ({{ $trigger.message.image.id }}) or from a previous media/upload node output.

Sample Configuration

{
  "resource": "media",
  "operation": "get",
  "accessToken": "{{ $credentials.whatsAppToken }}",
  "phoneNumberId": "123456789012345",
  "mediaId": "{{ $trigger.message.image.id }}"
}

Validation Errors

ErrorCause
accessToken is requiredThe accessToken field is empty or missing.
phoneNumberId is requiredThe phoneNumberId field is empty or missing.
mediaId is requiredThe mediaId field is empty or missing.
100 (Meta)Invalid media ID — the ID does not exist or belongs to a different phone number.
190 (Meta)Access token is expired or invalid. Rotate the token in BizFirst Credentials Manager.
missing_urlMeta returned a success response but the URL field was absent. Retry once after a short delay.
parse_errorMeta returned a non-JSON response, typically during a temporary API outage.

Output

Success Port

Fires when Meta returns the media metadata. Note that the url expires after approximately 5 minutes — use it immediately or pass it directly to media/download.

FieldTypeDescription
mediaIdstringThe requested media object ID, echoed back.
urlstringTemporary signed URL to download the media binary. Expires in ~5 minutes.
mimeTypestringMIME type of the media file, e.g. image/jpeg.
sha256stringSHA-256 hash of the file content for integrity verification.
fileSizenumberFile size in bytes.
statusstring"success" on success.
errorCodestringEmpty on success.
errorMessagestringEmpty on success.
rawResponsestringFull raw JSON response from the Meta API.

Error Port

Fires when Meta cannot locate the media or the request fails.

FieldTypeDescription
statusstring"failed" or "error".
errorCodestringMeta error code or BizFirst internal code.
errorMessagestringHuman-readable description of the failure.
rawResponsestringRaw API error JSON for diagnostics.

Sample Output

{
  "mediaId": "1234567890123456",
  "url": "https://lookaside.fbsbx.com/whatsapp_business/attachments/?mid=1234567890123456&ext=...",
  "mimeType": "image/jpeg",
  "sha256": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2",
  "fileSize": 204800,
  "status": "success",
  "errorCode": null,
  "errorMessage": null,
  "rawResponse": "{\"url\":\"https://lookaside.fbsbx.com/...\",\"mime_type\":\"image/jpeg\",\"sha256\":\"a1b2...\",\"file_size\":204800,\"id\":\"1234567890123456\",\"messaging_product\":\"whatsapp\"}"
}

Expression Reference

ValueExpressionNotes
Media ID{{ $output.getMedia.mediaId }}Echoed ID — pass to media/download or media/delete.
Download URL{{ $output.getMedia.url }}Use immediately — valid for ~5 minutes only.
MIME type{{ $output.getMedia.mimeType }}Use in a Switch node to route images vs. documents vs. audio.
File size (bytes){{ $output.getMedia.fileSize }}Compare against storage quota limits before downloading.
SHA-256 hash{{ $output.getMedia.sha256 }}Compare against a known hash for integrity verification.
Status{{ $output.getMedia.status }}"success" on success.

Node Policies & GuardRails

Policy AreaRecommendation
URL expiryThe returned url expires in ~5 minutes. Never store it in a database or pass it to a long-running async step. Use media/download in the same workflow branch immediately after this node.
Credential storageStore the access token in BizFirst Credentials Manager. Never paste it directly into node configuration.
Media ID scopeA media ID is only accessible from the same phone number ID that received or uploaded the media. Cross-account access returns error 100.
Size-before-downloadUse the fileSize output in an IfCondition node to gate the download step and prevent large files from overwhelming downstream storage.
Error port handlingAlways connect the error port. A deleted or expired media ID returns a 100 error — the workflow should log the event and notify the relevant team.
Integrity checksFor compliance use cases, store the sha256 value alongside the downloaded content so integrity can be re-verified later.

Examples

Inspect Inbound Image Before Processing

{
  "resource": "media",
  "operation": "get",
  "accessToken": "{{ $credentials.whatsAppToken }}",
  "phoneNumberId": "123456789012345",
  "mediaId": "{{ $trigger.message.image.id }}"
}

A webhook trigger fires when a customer sends an image. This node fetches the metadata first. An IfCondition node downstream checks $output.getMedia.fileSize — files under 5 MB route to media/download and then to an OCR processor, while larger files are rejected with a courtesy text reply.

Route by MIME Type

{
  "resource": "media",
  "operation": "get",
  "accessToken": "{{ $credentials.whatsAppToken }}",
  "phoneNumberId": "123456789012345",
  "mediaId": "{{ $input.inboundMediaId }}"
}

A document ingestion workflow uses a Switch node on {{ $output.getMedia.mimeType }}: application/pdf routes to a PDF parser, image/jpeg and image/png route to an image analyser, and everything else routes to a generic binary storage node.

Pre-Download Integrity Check

{
  "resource": "media",
  "operation": "get",
  "accessToken": "{{ $credentials.whatsAppToken }}",
  "phoneNumberId": "123456789012345",
  "mediaId": "{{ $input.mediaId }}"
}

A compliance archival workflow first fetches metadata and stores sha256, mimeType, and fileSize in an audit log record. It then passes the mediaId to media/download and re-computes the hash server-side to confirm the content matches the metadata before archiving.