Access any data from the IUDX platform

Hi, I am running this command from the command prompt and getting the same error. This is a snippet from one of the documents.

C:\Users\sanjana>curl -X POST https://pudx.resourceserver.iudx.org.in/resource-server/pscdcl/v1/search -H "Content-Type: application/json" -d "{"id": "rbccps.org/aa9d66a000d94a78895de8d4c0b3a67f3450e531/pudx-resource-server/aqm-bosch-climo/Susgaon_46","time": "2019-10-30T09:30:00.000+05:30/2019-10-30T12:00:00.000+05:30","TRelation": "during" }"

Internal Server Error

Hi Sanjana. Looks like the quotes you are using are unicode quotes.
Here’s the same snippet with proper quotes.

curl -X POST https://pudx.resourceserver.iudx.org.in/resource-server/pscdcl/v1/search -H "Content-Type: application/json" -d '{"id": "rbccps.org/aa9d66a000d94a78895de8d4c0b3a67f3450e531/pudx-resource-server/aqm-bosch-climo/Susgaon_46","time": "2019-10-30T09:30:00.000+05:30/2019-10-30T12:00:00.000+05:30","TRelation": "during" }'

Hi, For some reasons I am not able to post the output here. But the error exists.
I still get Internal server error along with a message that the 302 Found, the document has moved here response.

Can you give us the entire command again?

I am not able to post the output of the command you suggested me to try. It says my post is flagged.

Can you try the same now?

Can you paste the code using preformatted text option.
Screenshot%20from%202020-01-10%2015-13-37

C:\Users\sanjana>curl -X POST https://pudx.resourceserver.iudx.org.in/resource-server/pscdcl/v1/search -H "Content-Type: application/json" -d '{"id": "rbccps.org/aa9d66a000d94a78895de8d4c0b3a67f3450e531/pudx-resource-server/aqm-bosch-climo/Susgaon_46","time": "2019-10-30T09:30:00.000+05:30/2019-10-30T12:00:00.000+05:30","TRelation": "during" }'
Internal Server Error<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved <a href="https://cps.iisc.ac.in/aa9d66a000d94a78895de8d4c0b3a67f3450e531/pudx-resource-server/aqm-bosch-climo/Susgaon_46,time:">here</a>.</p>
</body></html>
curl: (3) URL using bad/illegal format or missing URL
curl: (6) Could not resolve host: during
curl: (3) unmatched close brace/bracket in URL position 1:
}'
 ^

Hi sanjana,

This curl command works fine for me.
Something seems wrong with your network or machine.

Arun

Oh ok. Can you please tell me if there is any environment setting that needs to be done before running this command.

These commands definitely work on Linux.
Give me some time to try them on windows and get back to you. Alternatively, you can use postman too by importing the collection.

Sure. Thank you so much.

Did you try the Postman collection?

No I haven’t tried it with the Postman collection. However in windows cmd I get the same error I mentioned earlier.

Can you try a different shell, like Powershell?

I have added the output screenshot below with this exact command that i tried with powershell.
But the error persists.

Hi.
Looks like the “curl” command is an alias to powershell curl and the parameters are different.
You can refer to this documentation here

The command will now be

curl -Method Post https://pudx.resourceserver.iudx.org.in/resource-server/pscdcl/v1/search -Body '{ "id" : "rbccps.org/aa9d66a000d94a78895de8d4c0b3a67f3450e531/pudx-resource-server/pune-iitm-aqi/Alandi", "time": "2019-11-16T00:00:00+05:30/2019-11-28T00:00:00+05:30", "TRelation": "during" }'

Please also use postman. It will give you an appropriate snippet which you can directly use.
Download Postman here -


Import this collection by pasting -