Pull data fro API using Azure Logic Apps - azure-logic-apps

I need to Pull data from a 3rd party API and minor process that data and then send it to DB. Is there any connector to pull API data using Logic App? Any connector or Action? How to start.

It seems you wants to fetch data from any API using logic App right?
Yes you can do it using Logic Apps Custom Connector on azure portal see the screen shot below:
How to connect any API with Custom Connector:
Step 1: Create New Custom Connector
To create a Custom Connector go to azure portal and in All services search for Logic Apps Custom Connector click on it and Add New Connector. see the screen shot:
Step 2: Edit Custom Connector
Once you have created new custom connector then to add your API with it you have to Edit it to configure your API request and response with the new custom connector
Step 3: Configure Custom Connector
There are 3 part of custom Connector
1. General
Here you would see Host enter your API main domain name like dotnetavalanche.azurewebsites.net
Leave base URL blank
2. Security
For test propose no authentication required just leave it blank
3. Definition
enter a Summary note , description but surely enter a Operation ID which should unique like TestAPI
Request
Then in Request selection click on Import from sample and enter your API method type Like POST or GET
Full URL of your API for example: https://dotnetavalanche.azurewebsites.net/api/PartnerBotRequest
See the screen shot:
Response:
Here click on Add default response and add Json of your expected response from API
Call Your custom Connector On Azure Logic App
Go to azure logic App and click on Http Request on Request Body JSON Schema paste below JSON
{
"type": "object",
"properties": {
"title": {
"type": "string"
},
"description": {
"type": "string"
},
"email": {
"type": "string"
}
}
}
Then click on Next Step and add your custom connector like below:
Then finally add new Step as Response
Configure the response as below screen shot:
If you still have any query feel free to share. Thanks and happy coding!

Related

How to query for the list of members and their basic profiles, including Teams user IDs?

Is there an end-to-end sample provided to query for the list of members and their basic profiles, including Teams user IDs and Azure Active Directory (Azure AD)?
I am following https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/get-teams-context?tabs=json and microsoft graph Postman collection, however it seems too complex for me to understand.
I need to fetch all the userId under for my MS Team
The document you are following is indeed used to get the information you need, including Teams user IDs and Azure Active Directory (Azure AD).
I'm not sure where you don't quite understand. But it's strongly suggested to firstly learn about Bot Framework Rest API reference.
You should pay attention to how to get the Base URI (serviceUrl). After that, you could issue a GET request on /conversations/{teamId}/members/, using the value of as the endpoint: serviceUrl.
Like this:
GET https://{serviceUrl}/v3/conversations/{teamId}/members/
Authorization: Bearer {access token}
Content-Type: application/json
For details about how to obtain an access token for your bot, see Authenticate requests from your bot to the Bot Connector service.
Now you have the request endpoint and headers. You could test the Rest API in Postman.
Below are the commands I used to fetch Team user IDs
Step 1: Request an access token from the Azure AD v2 account login
service
Step 2: Obtain TenantID
Step 3: Get User Access Token
https://login.microsoftonline.com/{{TenantID}}/oauth2/v2.0/token
Step 4: Call My Joined Team, get ID
https://graph.microsoft.com/v1.0/me/joinedTeams
Step 5: Findchannels of a team
https://graph.microsoft.com/v1.0/teams/{{TeamId}}/channels
Step 6:
Find all the user profile using following
https://{{serviceUrl}}/v3/conversations/{{channelid}}/members/
The best way to get teams user details is by fetching roster details.
You can also use Graph API for getting members of a team/group. But this API provides basic details of user. like
[
{
"#odata.type": "#microsoft.graph.user",
"id": "xxxxxxx-95ea-xxxxxxxxx",
"businessPhones": [
"xxxxxxxxxxxxx"
],
"displayName": "Vivek",
"givenName": "Vivek",
"jobTitle": "xxxxxxxx",
"mail": "xxxxxxxx#microsoft.com",
"mobilePhone": "xxxxxxxxxxx",
"officeLocation": "LINCOLN xxxxxxxxx",
"preferredLanguage": null,
"surname": "Shah",
"userPrincipalName": "xxxxxxxx#microsoft.com"
},
]

Checkbox Subscribe for MailChimp with React JS web application

I'm trying to integrate a MailChimp checkbox opt-in feature on an existing React form. The entire site is a React web application. I've been checking around for solutions for hours, but still can't find anything. Any ideas?
You should use Mailchimp 3.0 API
Create an API key here: https://admin.mailchimp.com/account/api/
Send a POST request to the following endpoint with your user data
Endpoint:
https://<data_center>.api.mailchimp.com/3.0/lists/<list_id>/members/
Structure of data to send:
{
"email_address": "urist.mcvankab#freddiesjokes.com",
"status": "subscribed",
"merge_fields": {
"FNAME": "Urist",
"LNAME": "McVankab"
}
}
You can get the data_center for your Mailchimp account when you enter to your dashboard, in the web browser check the URL. If for example, you have https://us7.admin.mailchimp.com/account/api/ your data_center will be us7.
And to obtain the list_id of the list you want your users to subscribe, check the following link as there are several ways to obtain it: Find your list ID
After that you just have to handle the data for your subscriber into React state and send it on your form submit.
For more details, check Mailchimp API 3.0 documentation here

DocuSign Status not

I am a newbie to DocuSign integration with SalesFocre. I have DocuSign and Salesforce connected using connect settings, and am sending a DocuSign document from a custom object in salesForce. However, the DocuSign Status and the DocuSign Recipient Status are not populating on the Custom object. DocuSign Customer Support confirmed that my connect settings on DocuSign and salesForce are correct. In the DocuSign logs I can see the "dsfs__DocuSign_Status__c succeeded". But I do not see the same in the related list of the custom object. I can see the DocuSign status object in SalesForce shows all the envelopes but no related list records on custom object. The support person thinks that since the DocuSign integration is done using REST api, she will not be able to investigate the issue any further.
My REST api call is as per the sample code in DocuSign rest api implementation. However I do not know how do we notify the DocuSign of the relationship between the custom object and the envelope? I have not come across any documentation on this. Support person thinks that that might cause this issue. I am on a time crunch and will appreciate any help I can get.
If DocuSign Status and DocuSign Recipient Status aren't populating on the Custom Object in SFDC, I'd suspect that you've missed something in terms of configuration. I'd suggest that you verify that all settings have been configured properly (in both DocuSign and SFDC), as described in this article: https://support.docusign.com/guides/dfs-admin-guide-add-ds-status-to-custom-object.
UPDATE:
In response to your comment below that contains a SOAP code snippet, it looks like that snippet is simply adding a custom field to the Envelope. Do I understand correctly that you're creating the envelope using the REST API? If so, then the equivalent REST API request to add the custom field when you create the Envelope (in the same manner as your SOAP snippet appears to be doing) would be:
POST /v2/accounts/{accountId}/envelopes
{
"emailSubject": "EMAIL_SUBJECT",
"emailBlurb": "EMAIL_BLURB",
...
"customFields": {
"textCustomFields": [
{
"name": "DSFSSourceObjectId",
"value": "ID_OF_THE_CUSTOM_OBJECT_IN_SALESFORCE",
"show": "false"
}
]
}
}
Note: I've included the emailSubject and emailBlurb properties in this request example simply to show that the customFields property is a top-level property in the "Create Envelope" request body. Depending upon your implementation specifics, you may or may not be including emailSubject and emailBlurb in your "Create Envelope" request, and your request will most certainly contain additional properties which I haven't included in the example above. The important take-away here, as it relates to your question, is that in order to add a custom field when creating an Envelope using the REST API, you must include the customFields property as a top-level property in the request body, as shown in the example above.

App Engine Admin API Error - The "appengine.applications.create" permission is required

We would like to automatically create a project ID and install our ULAPPH Cloud Desktop application using the App Engine Admin API (REST) and Golang.
https://cloud.google.com/appengine/docs/admin-api/?hl=en_US&_ga=1.265860687.1935695756.1490699302
https://ulapph-public-1.appspot.com/articles?TYPE=ARTICLE&DOC_ID=3&SID=TDSARTL-3
We were able to get a token but when we tried to create a project ID, we get the error below.
[Response OK] Successful connection to Appengine Admin API.
[Token] { "access_token" : "TOKEN_HERE", "expires_in" : 3599, "token_type" : "Bearer" }
[Response Code] 403
[Response Body] { "error": { "code": 403, "message": "Operation not allowed", "status": "PERMISSION_DENIED", "details": [ { "#type": "type.googleapis.com/google.rpc.ResourceInfo", "resourceType": "gae.api", "description": "The \"appengine.applications.create\" permission is required." } ] } }
We are just using the REST API calls. Request for token was successful as you can see above and the scope is ok as well. Now, when we posted the request to create application, we are having the error that says "appengine.application.create" permission required.
How do we specify the permission?
What are the possible reasons why we are getting that error? Do we missed to send a field in JSON or in query?
As per below link, we just need to pass the json containing the id and location. We also just need to pass the token in the Authorization header. The same logic I have used successfully in accessing Youtube, Drive APIs etc so not sure what needs to be done since I have followed the docs available.
I have also posted the same issue in Google Groups and now waiting for their reply.
It seems you've given no details about how you set up the account you're using to authorize the request. You'll need to make sure the appengine.applications.create permission is given to the account you're using, as mentioned in the error text. You can use the Google Identity and Access Management (IAM) API for this.
(by the way, I'd given this answer in the original thread, although you didn't reply or seem to take action on it. check it out! this is likely the solution you need!)

How does a service identify the user?

Use case:
A user takes a beautiful photo and wants to save it to their evernote account.
User authorizes with OAuth 2.0. The service stores their credentials.
Just after the OAuth 2.0 dance completes, the service inserts a contact called "Save to Evernote".
Next, the service subscribes to updates in this user's timeline by inserting a subscription for the timeline collection.
The user activates the contact. Save to Evernote is now fully set up.
Over time, the user takes photos.
The user shares a photo with Save to Evernote. This makes the timeline card associated with this photo accessible to the service.
Because the service is subscribed to timeline updates, a notification is sent to your service. This notification links to the timeline item containing the shared photo.
The service examines the notification and uses the included id to fetch the timeline card that contains the photo.
Next, the service examines the timeline item and uses the attachment ID to fetch the bytes of the photo.
The service uploads the photo to the user's Evernote.
Finally, the service constructs a new timeline card and inserts it into the user's timeline card with the success message.
From the Mirror API Documentation it appears that once a user shares a timeline item the service receives a POST quite like this:
{
"collection": "timeline",
"itemId": "3hidvm0xez6r8_dacdb3103b8b604_h8rpllg",
"operation": "UPDATE",
"userToken": "harold_penguin",
"verifyToken": "random_hash_to_verify_referer",
"userActions": [
{
"type": "SHARE"
}
]
}
Is the userToken a value that I receive when first authenticating the application? If so can I use that value to connect the POST received from Glass with the User saved in my database? If not how do I connect the share to my service's contact with the Glass user so that my service can perform services specific to that user on their behalf?
The userToken is indeed the field you use to correlate the notification back to the user who triggered it.
You set the userToken when you create a subscription for that user. Whatever value you specify when you insert the subscription is provided as the userToken for all of the notifications that it yields. This means that when you create subscriptions, you always want to use unique identifiers that your system can correlate back to the correct user.
For example:
Jane authenticates with your service. Jane has the unique user ID of 42 in your Glassware's database.
At the time of authentication, you subscribe to her timeline collection by inserting this subscription:
{
"collection": "timeline"
"userToken": "42",
"callbackUrl": "https://example.com/notify/callback"
}
Jane shares a photo with your Glassware.
A notification is sent to your service. It looks something like this:
{
"collection": "timeline",
"itemId": "3hidvm0xez6r8_dacdb3103b8b604_h8rpllg",
"operation": "UPDATE",
"userToken": "42",
"userActions": [
{
"type": "SHARE"
}
]
}
Your Glassware uses the userToken property to look up the correct user: Jane.
The rest of the story proceeds as you describe in your question.

Resources