TheSkullKid
Active member
I want to get the attachment from a post, but it looks like that this is not working:
To get the attachment key
Now try to get the attachment
This is the result:
Someone any ideas?
Thanks
To get the attachment key
Code:
curl --header 'XF-Api-Key: KEYXYZ'
--request POST http://localhost/api/attachments/new-key/ \
--data type=post \
--data context[post_id]=1234
Code:
curl --header 'XF-Api-Key: KEYXYZ' \
--request GET http://localhost/api/attachments \
--data key=GENERATED_KEY_FROM_ABOVE_COMMAND
Code:
HTTP/1.1 400 Bad Request
Date: Fri, 23 Sep 2022 10:10:01 GMT
Server: Apache/2.4.52 (Win64) OpenSSL/1.1.1m mod_fcgid/2.3.10-dev
X-Powered-By: PHP/7.4.27
XF-Latest-Api-Version: 1
XF-Used-Api-Version: 1
XF-Request-User: 1
XF-Request-User-Extras: {"conversations_unread":0,"alerts_unviewed":0}
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: private, no-cache, max-age=0
X-XF-Debug-Stats: {"time":2.7067,"queries":8,"memory":14.15}
Content-Encoding: gzip
Vary: Accept-Encoding
Content-Length: 137
Connection: close
Content-Type: application/json; charset=utf-8
{
"errors": [
{
"code": "required_input_missing",
"message": "Required input missing: key",
"params": {
"missing": [
"key"
]
}
}
]
}
Thanks