XF 2.2 Posting thread with attachment via REST API, receiving: attachment_key_context_wrong

Verringer

Active member
I'm like 4 hours into trying to get an attachment to upload to XF REST API and use it in a thread, so far I can't even get it to work in postman.

Uploading to /api/threads usually returns:
Code:
{
    "errors": [
        {
            "code": "attachment_key_context_wrong",
            "message": "The provided attachment key does not have the expected context.",
            "params": {
                "expected": "node_id=58"
            }
        }
    ]
}

Trying to post a thread to node 58.

I've just just about every combination of entering context[node_id], but this is my favourite so far:

1620439549789.png

File is uploading, the key is being created, just rejecting the key context constantly. Any help on the format of context would be a great help.
 
Last edited:

Mike

XenForo developer
Staff member
Based on your screenshot, that's not the correct context name/value. The input name would be context[node_id] and the value would be 58.
 

Verringer

Active member
Based on your screenshot, that's not the correct context name/value. The input name would be context[node_id] and the value would be 58.
Wow. The only combination I didn't try!

Could you get an example shoved in the docs at some point, I can't be the only person this stupid 🤣

Cheers mate.
 
Top