Created on 08-08-2018 02:17 AM - edited 09-16-2022 06:34 AM
I am trying to get census data from census.gov API's, and when I do a GET request using the configured url, I get Name or Service not known error. I am placing the zip code from previous updateAttribute processor in the url. Also, when I just do the same url in postman, I see the response in JSON, but it doesnt work in NIFI. Please help.
Created 08-08-2018 02:45 AM
Could you please add more details like processor configs screenshot's, Flow and Rest API URL that you are trying to get response from?
Created 08-08-2018 02:52 AM
I added the details as reply. Sorry. please take a look and let me know.
Created on 08-08-2018 02:50 AM - edited 08-17-2019 08:07 PM
This is my Properties of InvokeHTTP. The URL is https://api.census.gov/data/1994/zbp?get=ST&for=zipcode:&{zip}&key=mykey. The Zip attribute is coming from input file that is extracted using evaluateJSONpath and updateAttribute processor before InvokeHTTP. Hope this helps.
Created 08-08-2018 02:51 AM
@ Shu - I added the details as reply. Sorry. please take a look and let me know.
Created on 08-08-2018 03:06 AM - edited 08-17-2019 08:06 PM
TO get the value of attribute we need to use `${attribute_name}` in NiFi
I am having zip attribute to the flow file,I tried with below as Remote URL in Invoke Http processor and able to get the response back
https://api.census.gov/data/1994/zbp?get=ST&for=zipcode:${zip}
Example:
Flow:
Generateflowfile configs:
Output:
[["ST","zipcode"], ["48","77058"]]
I'm not sure about this &key=mykey parameters in your shared URL. If you are not using them just exclude them from the Remote URL and run again.
Created 08-08-2018 02:15 PM
Shu, I tried now removing the key and still it throws the same error.
Created on 08-08-2018 02:38 PM - edited 08-17-2019 08:06 PM
Sure,
Invoke HTTP configs:
\
Template for the flow:
Save/Upload the template to your nifi instance and test it out.
-
If the Answer helped to resolve your issue, Click on Accept button below to accept the answer, That would be great help to Community users to find solution quickly for these kind of issues.
Created 08-08-2018 02:54 PM
@Shu - The config is same as what you have given and still I get the same result. Not sure where the mistake is.
Created 08-08-2018 03:39 PM
Hmm, If possible please share your flow template (or) all the processors that you are using and configs screenshots of them.