Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Apache Nifi Flow Creation - Collecting data from RESTfUL APi

Highlighted

Apache Nifi Flow Creation - Collecting data from RESTfUL APi

New Contributor

Starting from the very top here.

I am very new to Nifi and usually OK in learning such new products, but this one I am unable to get my around.

I am trying to set up a process within Nifi to collect data from a 3rd Party RestAPi but I am struggling to figure out which is the best way to go about this.

I've managed to create a Json for this in Postman: at the bottom of this question, however I am unable to find the correct processors within Nifi to get this to work.


Example 1,

Obtaining data from a specific file on the 3rd party APi I have done the following:

InvokeHTTP - UpdateAttribute - PutFile

Which has translated to:

Made the call to the APi grabbed the data from the specified file - Updated the filename to store as CSV (as the data I am reading from is CSV data however without this I am just pulling in a file with no extension) by using ${filename}.csv - Moving the file to a specified location.

My problem now, so that the file is coming through however it is saving with a file name such as


107756-1554975727508.png

Instead of 2019-04-02T01:50:00Z.csv",


Any ideas please?


Json below - sensitive information has been removed.

{
"info": {
"_postman_id": "a49d000c-0000-4ac6-af31-34a854e8fdxx",
"name": "test",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "LIVE - xxxxxxx list scheduled reports download",
"request": {
"auth": {
"type": "basic",
"basic": [
{
"key": "password",
"value": "xxxxxxxxxxxx",
"type": "string"
},
{
"key": "username",
"value": "00000/xxxxxx/reportingApi",
"type": "string"
}
]
},
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "https://api.xxxxxxxx.com/reports/v1/scheduledReports/download/000000/201904/CTDDaily/2019-04-02T01:50:00Z.csv",
"protocol": "https",
"host": [
"api",
"xxxxxx",
"com"
],
"path": [
"reports",
"v1",
"scheduledReports",
"download",
"000000",
"201904",
"CTDDaily",
"2019-04-02T01:50:00Z.csv"
]
}
},
"response": [
{
"name": "LIVE - xxxxxx list scheduled reports download ",
"originalRequest": {
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "https://api.xxxxxx.com/reports/v1/scheduledReports/download/000000/201904/CTDDaily/2019-04-02T01:50:00Z.csv",
"protocol": "https",
"host": [
"api",
"xxxxxx",
"com"
],
"path": [
"reports",
"v1",
"scheduledReports",
"download",
"000000",
"201904",
"CTDDaily",
"2019-04-02T01:50:00Z.csv"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "plain",
"header": [
{
"key": "Date",
"value": "Fri, 05 Apr 2019 15:21:14 GMT"
},
{
"key": "Content-Type",
"value": "text/csv"
},
{
"key": "Transfer-Encoding",
"value": "chunked"
},
{
"key": "Connection",
"value": "keep-alive"
},
{
"key": "Vary",
"value": "Accept-Encoding"
},
{
"key": "Content-Encoding",
"value": "gzip"
},
{
"key": "Expect-CT",
"value": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\""
},
{
"key": "Server",
"value": "cloudflare"
},
{
"key": "CF-RAY",
"value": "4c2c82b85cad6a97-LHR"
}
],
"cookie": [],