Search code examples
soqlsocratasoda

How to pass user authentication of a private dataset through SODA API?


I need to access a private data set in socrata using SODA API. Suppose below link is the data set

https://data.cityofchicago.org/resource/xxxx-xxx.json

I get the following error when try this.

"error" : true,
"message" : "You must be logged in to access this resource"

I have valid credentials to access the data set. But how can I pass it through SODA API calls? I tried the below code but it doesn't work.

https://data.cityofchicago.org/resource/xxxx-xxx.json?$username='myname'&$password='pwd@123'


Solution

  • You'll need to use either HTTP Basic or OAuth 2.0 to authenticate. We have details on how to do that on the developer portal.

    Make sure you also provide an application token, as detailed in those docs.