Api request with curl

Hello im trying to request some information from an api.

this is the curl request:

curl -H “x-api-key: API_KEY” MY_WEBSITE --ssl-no-revoke -d ‘{“instances”: [“This is my Problem”]}’

I’ve donwloaded the ‘webapi.activities’ package but im not sure how to cinfigure the http request acitivity.

Can somebody help me out?

Furthermore I get the following Error when executing the curl request in CMD (which I dont understand):

Hey @Pathler

You need to use HTTP activity from the package.

Pass this in the header props → -H “x-api-key: API_KEY”

Pass this in the Body → -d ‘{“instances”: [“This is my Problem”]}’

And URL in the Endpoint prop.

Try this please and let us know.

Thanks
#nK

1 Like

Thanks for your Answer @Nithinkrishna,

pls check if I did, what you mean:

Request Method is HEAD? And Authentication is NONE?

Please replace My-Website with proper URL

Also the instances you passed is not right, click Ok and go inside to write that instances thing in the body prop of the activity as json,

{“instances”: [“This is my Problem”]}

Alright, I did. When I used the ‘HEAD’ Method I recieved unnecessary info.
I tried ‘GET’ but recieved this error:

{“code”:405,“message”:“The current request is matched to the defined url template "/predict" but its http method is not allowed”}

I used an online curl sender: and got the following output from the curl:

The upper Part is what i recieve when I use the “HEAD” Method - but I would like to recieve the information at the buttom.

The data you are showing here is response.

Is there request details or any docs please ?

Yes the request is the curl as written above

As per the CURL it’s the same as I was saying. Were you able to achieve it or you still need help ?

I did exactly what you told me with the activity, but still not getting the information :confused:

Please show the activity screenshot with props !

Here it is:

Hey @Pathler

Remove -d and a space from the body of the request.

Also please change the Request method from Get to POST

Make sure your URL is right & run the request.

Thanks
#nK

Thanks but still getting the error:

{“message”:“The current request is matched to the defined url template "/predict" but its http method is not allowed”,“code”:405}

Hey @Pathler

What’s the HTTP Method you need to use as per any docs if you have ?

Is it head ? Then use the same pls.

Thanks
#nK