imageResourceId, Create Video Post takes an imageResourceId, and Create Post Series takes a coverImageResourceId and a thumbnailResourceId.
Before you can set one of those fields, you must upload the image and obtain its resourceId. Uploading is a three-step flow: create the image, upload the bytes directly to storage, then confirm the upload.
All image endpoints require the
memberships_write OAuth scope. API keys have full access.Overview
- Ask Fourthwall to create an image, sending the file’s
byteSizeandchecksum. - Fourthwall responds with a signed, pre-authorized
uploadData.url, theheadersyou must send with the upload, asignedId, and theresourceIdyou’ll ultimately reference. - Upload the raw image bytes directly to cloud storage using the returned URL and headers.
- Confirm the upload with Fourthwall, passing back the
signedId. - Once confirmed, the
resourceIdis ready to be used on any endpoint that accepts an image resource.
Step 1 — Create the image
Compute the image’s byte size and a base64-encoded MD5 checksum, then call Create Image.| Field | Description |
|---|---|
uploadData.url | Pre-authorized URL to PUT the raw image bytes to. |
uploadData.headers | Headers you must send verbatim with the direct upload. |
uploadData.signedId | Opaque token identifying this upload. Pass it back in Step 3. |
resourceId | The ID you’ll use as imageResourceId, thumbnailResourceId, etc. |
Step 2 — Upload the bytes directly
PUT the raw image bytes to uploadData.url, sending every header from
uploadData.headers. This request goes to cloud storage directly — do not
send your Fourthwall Authorization header to it.
200 OK from storage with no body.
Step 3 — Confirm the upload
Tell Fourthwall the bytes are in place by calling Confirm Image Upload with theresourceId in the path and the signedId from Step 1 in the body.
204 No Content. The image resourceId is now
ready to use.
Step 4 — Reference the image
Pass theresourceId into whichever field the target endpoint expects. For
example, when creating a paid tier:
cURL
resourceId can be used for any image field across the Memberships API:
| Field | Used by |
|---|---|
imageResourceId | Create Tier, Create Audio Post, Create Video Post |
thumbnailResourceId | Create Post Tag, Create Post Series |
coverImageResourceId | Create Post Series |
Use
https://api.fourthwall.com for production. For testing against staging,
swap in https://api.staging.fourthwall.com.