AkbarB
AkbarB

Reputation: 530

Sanity GROQ query with Rest API

I am trying to query some data from my sanity project in a Retool app. So, I am using http query to send a GROQ GET request to the endpoint:

https://<projectId>.apicdn.sanity.io/<YYYY-MM-DD>/data/query/<dataset>?query=*[ _type == 'mytype' && date == '2024-01-17']

I keep getting this error:

{
  "error": {
    "description": "Unknown query parameter \" date \"",
    "names": [
      " date "
    ],
    "type": "httpUnknownQueryStringParameters"
  }
}

I do have a date field in my data of type mytype.

I think I may need to use encodeURIComponent(), but not sure how exactly. Any ideas?

Upvotes: 1

Views: 367

Answers (0)

Related Questions