REST API - Send Image to PEKATImage processing through API works on the principle of sending the image via HTTP request and getting a response with the result (Context by default). Only one image can be sent per request. (MODIFY & DELETE)
Widget Connector |
---|
overlay | youtube |
---|
_template | com/atlassian/confluence/extra/widgetconnector/templates/youtube.vm |
---|
width | 680px |
---|
url | https://www.youtube.com/watch?v=WkEYKFe9wMo&feature=youtu.be |
---|
height | 400px |
---|
|
...
Code Block |
---|
|
'http://127.0.0.1:8000/analyze_image?api_key=SUPER_SECRET' |
Example of sending Python code which sends images from a folder to Pekat project with API key:
Code Block |
---|
breakoutMode | wide |
---|
language | py |
---|
|
import requests
import os
request_session = requests.Session()
for image in os.listdir('images_folder'):
with open(os.path.join('images_folder', image), 'rb') as image:
response = requests.post(
url='http://127.0.0.1:8000/analyze_image?api_key=728a9180-8357-11ec-b645-e917eb5f5d27',
data=image.read(),
headers={'Content-Type': 'application/octet-stream'}
)
print(response.json()) |
...