Azure Api Management log user accessed api - azure

Is there any rest api that can be used to fetch api access detail for a user. To know how many times a user accessed a api and how many success or failure request were there. i am not able to use log-to-eventhub.

Thanks to #MayankBargali-MSFT's Q&A answer to similar kind of issue and posting here to help other community members!
Azure APIM will do monitor the APIs published but only listed details are logged as per the APIManagementGatewayLogs.
Based on your requirement, leveage the APIM reporting API and refer to Microsoft Doc for more information on reporting API.
To know who the user accessed particular API in APIM recently, You can call the List by Request API by adding the filter (For example, last 4 days from this day, apiID, etc.).
The above response will provide the details like apiID, timeStamp, userID that helps to find the details.
Still paraphrasing #MayankBargali-MSFT from the post linked above:
To know how many time that user accessed the API, use List by User API where it gives the overall result in which we need to filter with the apiID, then you can get the API Level count.
Point to note here is:
Filter might not work for every column. Therefore, you must modify the outcome at your client's end to perform more filtering and obtain the appropriate result. For further information, kindly consult the relevant API document. As long as you don't delete the APIM instance, the data will continue to be maintained permanently.

Related

Unknown Get calls are received and logged in Azure APIM

I have an instance of APIM which hosts multiple APIs. This include multiple post operations.
I have observed many Get calls being logged for the endpoint which are actually Post. I verified from client who uses it and they are not making any get calls for the same. When I searched IPs logged in app insights it belongs to Microsoft.
Where the actual API is post operation as shown below
May I know why these get calls are made? Is there any possibility these are from APIM?
I raised Microsoft ticket to understand why we are getting unknown Get calls. They analyzed IP address where its coming from then they got to know its coming from Microsoft Teams. If somebody post URL in Teams, then Teams trying to render the url in order to get some information to show in the chat. In this attempt it makes a Get calls

What endpoint in the Instagram API do I use to retrieve data from followed accounts such as the amount of followers they have?

I want to create an app that can show you the amount of followers and the amount of accounts followed by particular user that your account follows. Confusing I know....
What endpoint do I use to retrieve such data from followed accounts?
I have tried reading through the Instagram API documentation but it only shows a small amount of endpoints to be used. I know there are much more endpoints to be used, for example by apps such as "Unfollowers" where it can specifically list the accounts that you follow and that don't follow you back.
You can use the following endpoint of the unofficial Instagram API
https://www.instagram.com/graphql/query/?query_hash=c76146de99bb02f6415203be841dd25a&variables={"id":"USER_ID","include_reel":true,"fetch_mutual":true,"first":10}
to retrieve the first 10 followers.
The data of the followers is in the edges array:
data.user.edge_followed_by.edges
Since the API limits the data per request, you should make any subsequent requests as follows:
https://www.instagram.com/graphql/query/?query_hash=c76146de99bb02f6415203be841dd25a&variables={"id":"USER_ID","include_reel":true,"fetch_mutual":true,"first":10,"after":"END_CURSOR"}
where end_cursor is the value in the response:
data.user.edge_followed_by.page_info.end_cursor
Then for each of the users you follow can extract their USER_ID and use:
https://i.instagram.com/api/v1/users/USER_ID/info/
to get the count of each user.
Please note that you need to supply all the cookies for instagram.com for the requests. You can find a full list in the developer tools of the browser.
document.cookie does not deliver all the cookies, since some are sent automatically by the browser, so please look them up in the developer tools.
Hope it helps !

Chatbase API to get analytics data?

We are using Chatbase for multiple clients that we identify with a different version number.
See my previous question here: Track multiple context for the same Bot
We have a dashboard for all those clients and would like to show them their own data. A bit like Google analytics allows it.
So:
Is an API in the pipeline (I couldn't find any existing resources)
If not, in what alternative way could we get the data to present it?
We have a .csv export that is currently limited to the first 500 rows of your message variations report. It is on our roadmap to increase the scope of this report, however there is no official timeline for release.
Our recommendation for deploying an integration like you described in your message is as follows:
Have the user create a Chatbase account in order to obtain the API key
Have the user integrate their analytics on your platform by providing the API key
Send the messages from their bot to their Chatbase API
Provide the user deeplinks to the Chatbase reports from within your UI
Alternatively, you could configure your bot to send a redundant message to an internal database, or bigquery table to have access to all of your logs.
If you would like access to data you have sent to Chatbase up to this point, please contact chatbase-support#google.com and provide your bot's name and/or api key and we can provide a one-time export.

Connect Google calendar api and api.ai

So here is what i am trying to do :
I built a bot with api.ai for my business that is hosted on my webpage and my Facebook page right now. Bot works well.
I want to push it to the next step by allowing my customers to make querys on my calendar, ask to book a specific time, see if available, if not offer other time similar, then make a booking.
I have been reading this thread and the great answer attached to it but i think my case is a bit different.
I was wondering if the bot could always have a token so every guests won't have to Auth to query the calendar ?
Obviously i am new to this, i have been reading the guide of google calendar api and api.ai but i don't really see how to do that yet. I guess there is a way to store a token somewhere and then just trigger the query with some specific intents but not to sure how.
I have also done the node.js quickstart guide of the G-calendar api, and it works fine if that helps.
Thanks for your help !
You will probably want to use a Service Account that is permitted to the calendar in question. Service Accounts are similar to regular accounts, but they are expected to do server-to-server communication only, so the method to create an auth token is a little different to keep it secure.
See https://developers.google.com/identity/protocols/OAuth2ServiceAccount for more information about using Service Accounts.
In general, you'll be using a shared secret to create and sign a JSON Web Token (JWT) you send to Google's servers. You'll get back an access token which you'll then use to call the Calendar API. The access token expires in about an hour, at which point you'll need to repeat the process.
There are libraries available to do much of this for you. For example, if you're using the node.js library https://github.com/google/google-api-nodejs-client, then it will take care of this for you (although you need to modify the key file - see the documentation for details).

Foursquare - Venue Claim

We're working on uploading businesses to Foursquare via the API option. We ran a test and have a question but first, here's some background on our situation:
We managed to get venues/add working however, we had issues with venues/claim.
When we attempted to claim a clinic which already existed on Foursquare,
we received the response code 403 and the following details:
{meta={code=403, errorType=not_authorized,
requestId=59416bb6db04f547b5e4b8a5, errorDetail=not authorized to
claim via api}, response={}, notifications=[{item={unreadCount=0},
type=notificationTray}]}
The API documentation indicates that the user performing this API call “Must be venue manager”. We don’t know whether our account is a venue manager and foursquare hasn't been too helpful in telling us if it is or isn't.
Can anyone please let us know how can we become a venue manager?
We are going to have approximately 2,000 locations uploaded via API and of that amount, we anticipate existing clinics to be a reoccurring theme so any insights in making this an efficient process would be greatly appreciated!
Venue claims are generally not available via API. Business owners will usually go through this page (https://foursquare.com/venue/claim) to claim their business.
If you're interested in claiming via API, please send us a note at api#foursquare.com!

Resources