Client Key ID and Client Secret Key can be created in portal, on "For Developers" page.
Following information must be gathered:
file.jpg
image/jpeg
wc -c path/to/file.jpg
openssl dgst -md5 -binary < path/to/file.jpg | openssl enc -base64
prerequisites:
obtained data:
request:
curl --request POST \
--url https://api-users.fishial.ai/v1/auth/token \
--header 'Content-Type: application/json' \
--data '{"client_id": "<redacted>", "client_secret": "<redacted>"}'
response:
{"token_type":"Bearer","access_token":"<redacted>"}
prerequisites:
obtained data:
direct_upload
-> url
in response body)direct_upload
-> headers
in response body)signed_id
in response body)request:
curl --request POST \
--url https://api.fishial.ai/v1/recognition/upload \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <redacted>' \
--header 'Content-Type: application/json' \
--data '{
"blob": {
"filename": "Esox lucius.jpg",
"content_type": "image/jpeg",
"byte_size": 2204455,
"checksum": "EA5w4bPQDfzBgEbes8ZmuQ=="
}
}'
response:
{
"id": 134429,
"key": "p5tcq31tlb32yz8lmo8a1cr9v1g1",
"filename": "Esox lucius.jpg",
"content-type": "image/jpeg",
"metadata": {},
"byte-size": 2204455,
"checksum": "EA5w4bPQDfzBgEbes8ZmuQ==",
"created-at": "2022-03-31T01:37:53.830Z",
"service-name": "google_stage",
"signed-id": "<redacted>",
"attachable-sgid": "<redacted>",
"direct-upload": {
"url": "https://storage.googleapis.com/<redacted>",
"headers": {
"Content-MD5": "EA5w4bPQDfzBgEbes8ZmuQ==",
"Content-Disposition": "inline; filename=\"Esox lucius.jpg\"; filename*=UTF-8''Esox%20lucius.jpg"
}
}
}
prerequisites:
request:
curl --request PUT \
--url '<redacted>' \
--header 'Content-Disposition: inline; filename="Esox lucius.jpg"; filename*=UTF-8'\'''\''Esox%20lucius.jpg' \
--header 'Content-Length: 2204455' \
--header 'Content-Md5: EA5w4bPQDfzBgEbes8ZmuQ==' \
--data <image binary data>
response: (no body)
prerequisites:
q
)request:
curl --request GET \
--url 'https://api.fishial.ai/v1/recognition/image?q=<redacted>' \
--header 'Authorization: Bearer <redacted>'
response: (to be documented)