Hello all
I need to connect to a Socrata private dataset and for that I already tried the following configurations on the download tool:
1 - Add the username / password in the "Connection" tab in Download tool.
When I try this I get this error:
{
"error" : true,
"message" : "You must be logged in to access this resource"
}
2 - Use an app Token provided by Socrata
According to Socrata documentation I could use an App Token to get the authentication done. I've created the token and the instructions are these:
App Tokens
All requests should include an app token that identifies your application, and each application should have its own unique app token. A limited number of requests can be made without an app token, but they are subject to much lower throttling limits than request that do include one. With an app token, your application is guaranteed access to it's own pool of requests. If you don't have an app token yet, click the button to the right to sign up for one.
Once you have an app token, you can include it with your request either by using the X-App-Token HTTP header, or by passing it via the $$app_token parameter on your URL
So I've added the X-App-Token in the Header tab in the Download tool configuration. Then I got the same error:
{
"error" : true,
"message" : "You must be logged in to access this resource"
}
If I pass an incorrect token then I get this error:
{
"code" : "permission_denied",
"error" : true,
"message" : "Invalid app_token specified"
}
So I wonder, does anyone has experience configuring this connection with Socrata API?
Best regards
Rodrigo
Solved! Go to Solution.
Hi @calloni ,
For the authentication, the way I have just tested here and it is working as expected.
1. Create an API Key in developer settings
2. Encode with Base64 Encoder the following string APPID:APPSECRET
3. Create a column 'Authorization' with the string 'Basic ' + result from step 2
4. Configure the download tool with GET method and insert the 'Authorization' column as a header
5. Done!!!!
I have attached a workflow where you only need to insert the API ID and SECRET.
Let me know if that works for you.
Best,
Fernando Vizcaino
This is just amazing Fernando!!!!
Thanks so much!
Hi Fernando
I wonder if you could help me with a follow up question with Socrata.
My connection is working and is great, but I am only getting 1000 records from both JSON or CSV formats.
Any documentation I could use on how to download the whole dataset (it is about 120K rows). I dont see pagination info in the response from the original call to API.
Thanks in advance
Rodrigo
Hi @calloni ,
Take a look at the following link. https://support.socrata.com/hc/en-us/articles/202949268-How-to-query-more-than-1000-rows-of-a-datase...
It describes how you can get all your data.
Best,
Fernando Vizcaino
It worked like a charm! Thanks so much Fernando.