Replies: 1 comment
-
I struggled with it as well, until I came upon #2413 (comment). But it doesn't mention that you have to specify Until it is properly documented, here's a description for everyone who might need it: Send a multipart/form-data POST request to curl 'http://your.wiki.com/u' \
-H 'Authorization: Bearer API_KEY' \
-F 'mediaUpload={"folderId":0}' \
-F '[email protected]' And here's Python import requests
upload_data = (
('mediaUpload', (None, '{"folderId":0}')),
('mediaUpload', ('image.jpg', open('image.jpg', 'rb'), 'image/jpeg'))
)
response = requests.post('http://your.wiki.com/u',
headers={'Authorization' : 'Bearer API_KEY'},
files=upload_data)
print(response.content) And here's what it would translate into:
|
Beta Was this translation helpful? Give feedback.
-
Related to #2746 I would like to know if there is any documentation for the REST API for uploading image assets to Wiki.js?
The GraphQL API does not provide the ability to upload images, which means you cannot create pages that include images using the GraphQL API. In #2746 I was told that you could use the REST API to upload images, but there is no documentation for this that I have been able to find.
Thanks
Darren
Beta Was this translation helpful? Give feedback.
All reactions