HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

API v2: Is there an example of media post request?

Hi all,
Can anybody provide me with a working example of api/v2/media post request?
The example available in documentation, i.e. with this body:

  "file": "string",
  "type": "image"

doesn't work:

curl -X POST "https://t102.lan/api/v2/media" -H "accept: application/json" -H "Content-Type: application/json" -H "x-transient-key: 59OvswMXrFJzZhyu" -d "{ \"file\": \"string\", \"type\": \"image\"}"

500 - Internal Server Error:
  "message": "Argument 1 passed to Vanilla\\UploadedFileSchema::validateSize() must be an instance of Vanilla\\UploadedFile, string given, called in /local/www/templates-community/library/Vanilla/UploadedFileSchema.php on line 124"

Actually I need to create a media that stores zipped xml file. What body I should pass to api/v2/media post request?

Sign In or Register to comment.