Curl API Missing query Exception


#1

Hi Community,
I am trying to access grakn using curl command
curl -X POST -H "Accept:application/text" "http://localhost:4567/graph/graql/execute?keyspace=grakn&infer=false&materialise=false;" --data 'match $x isa person; limit 1;'

mentioned in the documentation link https://grakn.ai/pages/documentation/api-reference/api-reference.html
if fires back error
{"exception":"Missing mandatory query parameter [query]"}

please can anyone explain what i am doing wrong?..thank you


#2

Hi! I’m unable to reproduce the issue, what version are you using?


#3

Hi,

Thank you for the reply…

I am using version grakn-dist-0.15.0…

Here’s a snapshot for the same…

I think i messed up the title… sorry :sweat_smile:

I hope i conveyed my problem statement properly this time…


#4

Hi,

It looks like the docs are slightly ahead of themselves here! In the next version, you will provide the query in the body.

However, in 0.15.0 you instead provide it as a parameter:

curl -X POST -H "Accept:application/text"
"http://localhost:4567/graph/graql/execute?keyspace=grakn&infer=false&materialise=false&query=match%20\$x%20isa%20person;"

#5

Hi @felix

Thank you so much for the help!!

I tried it out and it worked.

Thank you very much :slight_smile: