Ergonode docs
Search…
Multimedia create
This is how you can create multimedia via API.
To create multimedia via API you need to use MULTIPART, not a standard query.
mutation {
multimediaCreate(input: {
name:"<choose_a_name>"
}) {
__typename
}
}
Example in Python3
from urllib import response
import requests
url = "https://marcin.ergonode.app/api/graphql/"
data = {
'upload': open('C:\\temp\\temp.png', 'rb'),
'query': (None, 'mutation{multimediaCreate(input:{name:"<choose_a_name>"}){__typename}}')
}
headers = {
'X-API-KEY': '<some_api_key>',
}
response = requests.post(url, files=data, headers=headers)
print (response.text)
Copy link