cURL to blocks AI automatic generator | Create blocks for any API Service with AI tool | Getaix.com

i tried in

Run Curl Commands Online (reqbin.com)

and also in 2 android apps and its working fine...

I believe I understand what is going on. You site is returning the data in a compressed format. If I use the --compressed option in your curl command it returns the data in my terminal (linux).

Remove:

-H "accept-encoding:gzip"

from your headers, and it should work.

ref

you are really genius man...

thanks a lot...

its working now

I see you also asked on Kodular - you should advise that you got your solution on the AI2 community :wink:

Ya... sure...

Hi, I wasnt sure if I should post in here or start a new question, as its not been updated recently.
I've been trying this and don't get any successful results.
This is the input which is an example given on the ORS website and gives results correct using Git Bash

curl -X POST \
  'https://api.openrouteservice.org/v2/directions/driving-car' \
  -H 'Content-Type: application/json; charset=utf-8' \
  -H 'Accept: application/json, application/geo+json, application/gpx+xml, img/png; charset=utf-8' \
  -H 'Authorization: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' \
  -d '{"coordinates":[[8.681495,49.41461],[8.686507,49.41943],[8.687872,49.420318]]}'type or paste code here

this is the output from cURL to blocks -

Which gives error.

{"error":{"code":2002,"message":"Parameter 'coordinates' has incorrect value or format."},"info":{"engine":{"build_date":"2024-03-21T13:55:54Z","version":"8.0.0"},"timestamp":1715408546132}}

I've tried various things including the "join" method mentioned above.
Any ideas ?

Put your coordinates in list blocks?

This gives the same result

It looks to be a list of lists...

Same result

{"error":{"code":2002,"message":"Parameter 'coordinates' has incorrect value or format."},"info":{"engine":{"build_date":"2024-03-21T13:55:54Z","version":"8.0.0"},"timestamp":1715416191406}}

Not quite...

:face_with_hand_over_mouth: I'm so sorry I make it so difficult for you to show me the way lol

Its obvious to see the difference when using "do it".
I do appreciate you guy's trying to educate me although its hard going for you.

There is a Web block to turn a structure into JSON text.

JSONTextEncode ?

Did your last effort work ?

yes, sorry, once you pointed out the easiest way to view the structure it all made sense and worked fine !

I used a tip from one of your replies to someone else's question to convert text to number as and it took me a little while to realise that the OSR API takes coordinates in longitude, latitude order. which now works fine.
image

I was looking for distance and duration only not directions, which are returned in meters and seconds which I have converted ok for my needs mathematically but out of curiosity I had a play around with trying to set the output to miles.
Changing this on the "API playground" adds "units":"mi" to the data line of the curl

-d '{"coordinates":[[-2.091320179410226,57.182416616039184],[-2.0937750440109335,57.14995786137407]],"units":"m"}'

But I couldnt find a way to add it to the line without turning it back into strings.
For my needs it's not important but curiosity makes me wonder how or if it would be possible to add the text without the extra "'s.

Like this ?

If your individual coordinates are coming in from a string, just multiply by 1 to get a number

image

OK cool, ill need to try and remember that, lists dictionaries tuples and sets and things can get confusing.
I've done the multiplication thing to convert my strings to numbers as in my last post ok, they are taken from a list of markers and all works well.
Thank you for your time and patience.

Hellooo everyone,
I’ve got some exciting news for you all – Getaix’s cURL to Blocks just got an upgrade! :confetti_ball:

I've been away for a bit, but lately, I've been working on Getaix.com by fixing bugs and adding new features to it.

Fix Mistakes :pen: - is a new feature which will fix issue in your curl command, though it won't generate blocks magically for you, it can help to fix your cURL syntax


Let me know your thoughts

Stay tuned, even more exciting stuff is on the way!

Feedback and improvement

I'm excited :smiley: to know your feedback and feel free share your thoughts

Home | About | Feedback | Privacy Policy | Contact Us

Made with :heart:

Thank You
Jerin Jacob

3 Likes

AI blocks generator here :confetti_ball:

Hey Guys,

I'm excited to annouce latest update to Getaix cURL to Blocks

What's New !

  • Create blocks for any online service with AI tool
    • For example,

      "Create api call for ChatGPT send message"
      Check more examples here -> Getaix cURL to Blocks

With this tool you can generate minimal blocks for your api call and avoid large extensions

  • Dark theme, More comfortable view
  • Improved with dictionaries and list
  • Feel it - You can now listen feedback sound when blocks being generated

Stay tuned, even more exciting stuff is on the way!

Feedback and improvement

I'm excited :smiley: to know your feedback and feel free share your thoughts

Home | About | Feedback | Privacy Policy | Contact Us

Made with :heart:

Thank You
Jerin Jacob