Share feedback, ideas and get community help

D
F
M
a
g

Using HTTP Request block successfully with imagga.com

Ok, looking for documentation or specific help. I want to use imagga.com api to analyze an image and then give me back the most common color or colors.

Here is the documetation:

https://docs.imagga.com/?shell#colors

There are different code examples on the right. But I just need to know where to put things in the typebot block setup.

How do I set up the athentication and then how do I put in the parameters? To make it all work.

I will be using the upload URL for the uploaded images and just neeed the API to analyze and return colors as HEX or even RGB values.

Thanks!

In general, any good help on understanding and using APIs would be good too. I do want to learn and get away from no-code tools such as Zapier as much as possible if I can just use the APIs myself.
B
g
6 comments
Thanks @Baptiste ! I watched the video and I had learned most of that from the help docs page too, but still there was not specific code that would work in the body like I wanted.

The only other API that I had gotten working is a POST request and the service gave me the code directly which I tried in the custom body, basically this:

{
"document_uid": "{{DocID}}",
"api_key": "MY_KEY",
"format": "json",
"image_type": "jpeg",
"modifications": [
{
"name": "ColorOverlay",
"background-color": "{{CustomHex}}"
}
]
}


Which seems the same as your example. Is that JSON?

So immaga doesn't have anything in their examples in their documentation here:

https://docs.imagga.com/

I tried to create my own in the format above but the authentication wouldn't work. I figured out from the immaga docs and chatGPT that I had to get my authorization into the headers as a key:

Authorization

And the value

Basic My_API_Key:MyAPI_Secret(in Base64 format)

Immaga supplies the above on the user dashboard.

Then for the url input, I tried putting it into the body as a JSON like this:

{
"imageurl": "{{ImageUpload}}"}But that doesn't work it gives an error it doesn't have parameters. All of the examples in the docs are:cURL Python PHP Ruby Node.js Objective C Go _ C#

I've also seen at "APILayer" which has other APIs I want to use have additionally

Javascript and Swift

I guess what I am wondering is how to know how to enter the parameters and the options/proper ways to do so because I want to be able to use any API sucessfully.

For this one I figured out (with the help of ChatGPT and me giving it the docs URLs and asking it for specific steps) that I needed to use the query parameters to get the immaga API to work for me.

I have also figured out I can just append the values to the URL for that one so take a look at the images to this comment- those both worked.
Attachments
Screen_Shot_2024-08-04_at_4.55.40_PM.png
Screen_Shot_2024-08-04_at_4.56.19_PM.png
And I guess I wrote how I solved this in such detail because for someone like me that doesn't have experience with these sort of things, I'm trying to show that is frustrating from the information I have and then what I need to know to make these APIs work. I want to get away from using Zapier and similar tools and think I can use this to do that.

And so if others like me want to learn to use the HTTP block and APIs maybe this will help too- but if anyone has any insight to fill in the blanks it would be helpful:

How do I know if I can use a JSON object for the API request?

How do I know how to enter the data to properly authenticate?

How would I translate other code examples to what will work in typebot?

Thanks for any insight into all of this! (and sorry I am not a coder or as experienced in those things, I just keep at things until I solve things so I guess I learn enough to be dangerous/get what I want done).
How do I know if I can use a JSON object for the API request?
Your service should have an API documentation.
I can't really help more on this
HEY @Baptiste welcome back!!! I figured you were busy with Olympics or something.

So I have gotten way more familiar with APIs and testing and using them- less of an issue now. I have been using ChatGPT to help me when I run into problems and also learned how to use Postman to test API requests and get more info, errors etc.
Add a reply
Sign up and join the conversation on Discord
Join