I am using Web Activity to get the response from an API. The API takes a Csv file as its body parameter along with some string. I tried using this link How can i pass file as parameter in post request (Web Activity) Azure Data Factory? but could not succeed, I was getting the below error
The other help says to use logic apps for this , has anyone tried using web activity for posting form-data.
Related
I'm trying to use Azure Data Factory to connect to QuickBooks Online General Ledger using OAUTH2. My approach is to first create a pipeline with a Web Activity to perform a POST call to receive the authentication token, then create a Copy Activity to read a JSON returned from QuickBooks. My approach is based on this blog. from Alex Volok Consultancy.
I have been unable to use the Web Activity successfully. I am unsure of the parameters and how to configure the Web Activity but have tried many different combinations trying to get this to work.
My desired result is to get QuickBooks Online data into Azure, is this the correct approach?
If this is not the best approach, what is?
If this is the correct approach, the attached screenshot shows my attempt at creating the Web Activity parameters to retrieve the authentication token that is currently not working. Any help is appreciated.
Please follow the below approach. It will solve your problem.
Sample URL : http://restapi.adequateshop.com/api/authaccount/login
Postman:
Using Postman, I generated a bearer Token for testing.
I used the same URL with web Activity and generated a bearer Token in the Azure data factory.
Use Your User id and Password as Body.
Output:
For more information refer this SO Thread and Blog by Ashok Patel
My InvokeRESTAPI displays the following if executed:
I can see a Response field printed that is empty.
Can I somehow use this to get a value back from the API reply and use it to call another template with it?
On the task itself I am using this parameter:
successCriteria: eq(root["status"], "successful")
So I would assume that if there is some custom success criterion then I would be able to use a value from the response in order to define it.
Based on your screenshot, you are using the API to post the json content to Azure Logic App workflow.
So you need to add the Response Action in Azure Logic App to add response content to the work flow.
Here are the steps:
In Logic App:
Then when you run the API in Invoke Rest API task, it will show the customer response.
For more detailed info, you could refer to this doc: Construct the response
This is in relation to the question : -
How can I pass Body Parameters to API Post operation using API Management Action in Logic App?
Now I am able to pass JSON through the body of my logic app.
I would like to pass CSV or XML data as Body Parameters to API Post operation using API Management Action in Logic App.
Currently, the APIM accepts JSON sample only.
I am able to pass CSV or XML data using postman without any issues. Please find the attached pictures for details of this issue.
Thanks,
Paul
As I mentioned in comments, the solution is:
Add representation with "CONTENT TYPE" as text/csv and leave the "SAMPLE" and "DEFINITION" box empty like below screenshot:
And then in your logic app, request the api like this:
I am trying to use Azure Logic Apps to read data from one of the Salesforce objects which has huge number of records. The Salesforce connector fetches the record and returns the pagination link as #odata.nextLink. But when I try to use a JSON parser to read the value it’s coming as null.
I tried to access the nextlink in a browser but it requires authentication. What authentication do we pass here ?
I would like to use an until action to iterate till I get a next link . So how do I check the condition for the until loop ?
nextLink doesn't look like core Salesforce thing, it might be the OData connector preprocessing the results for you. You'd have to consult the documentation for the connector (if any).
Salesforce's REST API will return field with nextRecordsUrl if there's next page of results, you'd call that in loop until the field disappears. You'd call it like any other REST API resource available after login, by passing Authorization: Bearer <sessionId also known as accessToken here>. Again - probably the connector abstracts this away from you. Don't think you can send headers like that in browser, you'd need curl, Postman, SoapUI or similar http client.
If you don't get better answer and documentation is scarce - consider using raw REST API. Or Azure Data Factory has an almost-decent Salesforce connector?
https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_query.htm
I've got a simple Azure Logic App, which receives and emails out JSON data in a very basic HTML table format (created with a convertToTableAction).
Does anyone know of a way to instead send this out using an email template?
I've got a SendGrid account set up with my Azure subscription, but there doesn't seem to be any way to specify a template id with the Send email (v2) action in Logic apps.
I can't quite see how I'd edit the Logic App code to use the only SendGrid api that seems to support sending templates V3 either. (It is my first Logic app though, so I could well be missing a trick)
Really, any advice on how to send out a templated email would be appreciated.
As you mentioned that the logic app integrate the Sendgrid(V2) currently. You could give your feedback to Azure team.
If azure function is acceptable, you could add and run custom code for logic apps through Azure Functions
there is two way to do it ..
1) Using SendGrid Connector :
You need to create one azure function or web API pass request as your JSON outout string and replace with html content and get html in response
Pass html response in body of the send email action of SendGrid Connector
Details of SendGrid Connector
Please refer this link for Json data replaced to html
my explanation is very short but if you don't understand then i will help you in details