Retrieving document by ID with Stargate Document API returns error 404, "A document with the id ... does not exist"

57 views Asked by At

I have created a database in datastax and create a collection and its document. It gave me a documentID to list my collections or the data inside the document, now when i go to get the document by inserting appropriate fields and also paste document id as required, it is giving me Error 404 that document with this document id does not exist.

this is the screenshot of creating the document

this is the documentID i got after executing

This is my entered field while getting the document and the error is in the documentID i guess

This is my error

1

There are 1 answers

0
Erick Ramirez On

It looks like you've enclosed the document ID in double quotes (") when you specified it in the Swagger UI:

document-id: "ae7362d3-8571-4a97-a639-69961e07c59f"

As a result, the quotes (") are getting encoded as %22 in the URL and replaces the document ID as %22ae7362d3-8571-4a97-a639-69961e07c59f%22.

You should supply the document ID on its own without the double quotes and you should be able to retrieve it with the API call:

document-id: ae7362d3-8571-4a97-a639-69961e07c59f

For more info, see Developing with Document API. Cheers!