Image posts resulting in Blob Not Found #1840
-
I am writing an app to integrate into an existing CFML app. I have text posts working fine (https://bsky.app/profile/esatest.bsky.social) However, I'm not having any luck with an image post. My code gets all 200s on completion and I do get a $link back from uploadBlob but when I post that to createRecord, I get a post without an image. I'm posting the image as binary (I also tried base64) The response from uploadBlob is 200 with the following
My createRecord post json is
Running the following as suggested in another post (with the cid as a variable ofc)
I've been banging at this for a day and a half and am at a loss as to what I'm doing wrong. Especially when it appears everything is working the way it should. It's odd to me that I'm getting a $link value back if my upload isn't working. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The getBlob endpoint won't return any uploaded blobs until they've been successfully "anchored" to at least one post record. If we beautify your JSON, the issue becomes apparent - you haven't put the embed field inside the {
"embed": {
"images": [
{
"image": {
"ref": {
"$link": "bafkreigeo6ukmjkdnw2iujtuwonrohcnb35wngjzkprzh5ojowzosmkhoq"
},
"size": 311430,
"$type": "blob",
"mimeType": "image/jpg"
},
"alt": "brief alt text description of the image"
}
],
"$type": "app.bsky.embed.images"
},
"repo": "did:plc:vo37i5ooqwooxgkmbc3277kt",
"record": {
"text": "Image API Test posted at {ts '2023-11-09 15:47:45'}",
"createdAt": "2023-11-09T15:47:45-07:00",
"langs": [
"en-US"
],
"type": "app.bsky.feed.post"
},
"collection": "app.bsky.feed.post"
} |
Beta Was this translation helpful? Give feedback.
The getBlob endpoint won't return any uploaded blobs until they've been successfully "anchored" to at least one post record.
If we beautify your JSON, the issue becomes apparent - you haven't put the embed field inside the
record
object, and therefore it's being ignored silently. Since it never gets properly attached to the post, getBlob pretends it doesn't exist.