Forum Discussion
I am also getting authentication error- signature mismatch.
@Ish ,@Harikrish any solution you have pls do share.
Hi @Siva_Venna,
The advice I can offer is to check the values of the variables you input to the script are correct. For example if the endpoint is something like:
https://subdomain.domain.com/v1/resource?token=abcd123
Then the values would be:
var endpoint = 'https://subdomain.domain.com/v1/resource?token=' + encodeURIComponent('abcd123');
var host = 'subdomain.domain.com';
var canonical_uri = '/v1/resource';
var canonical_querystring = 'token=' + encodeURIComponent('abcd123');
I don’t think it’s possible to configure the CSV Formatter to do this at the moment. You might need to do something like the following to detect when there is no data:
So, on the ‘No Data’ branch, you can have a Mapper that defines the headers and a CSVFormatter that writes the document to the file. Not great, I wish I had a better answer.
Thanks tstack. That’s what we ended up implementing. Agreed, it is not great, especially for a document with dozens of header columns.
For others whom happen to search for this as I just did. The router approach is still required as far as I can tell for the “No Data” condition, but, an easier way to write a header only file is to parse your JSON and use a Constant with a File Writer. For example, the following will get a list of Keys from your JSON (headers) as an array, turn it into a string, then, remove the opening and closing brackets.
JSON.stringify(Object.keys($)).replace(“[”,“”).replace(“]”,“”)
You can drop that into a Constant Snap and write to file. Works well for this case.
Related Content
- 2 years ago