Not able to get Azure Billing Account Id - azure

I need to get Usage Details at Billing Account Scope for that firstly I used this API but It returns an empty value. I used the Bearer Access token for hitting this API.Is anything other than this am I missed?
Postman Request attached as screenshot

I believe you're using the wrong API. To get Billing info you must provide billing account name:
GET https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountName}?api-version=2019-10-01-preview
https://learn.microsoft.com/en-us/rest/api/billing/2019-10-01-preview/billingaccounts/get
PS: you can use the "try it" and test if it will return the information you need.
You can also query usage API and use one of the available dimensions to get cost related info:
POST https://management.azure.com/{scope}/providers/Microsoft.CostManagement/query?api-version=2019-11-01
https://learn.microsoft.com/en-us/rest/api/cost-management/query/usage

This api will return a value if account belongs to Modern billing

Related

Azure Api Management log user accessed api

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.

Can't I query for other account IDs because I don't have the review done?

I am using "business_discovery" with the IG API, which works perfectly for me. With this I get the id of the Instagram account I want to work on. But when querying for the insights of this account I get an error. I think it must be because I have to send the app for review. My question is, once I pass all the revisions, will I be able to query insights from commercial accounts that are not associated to my account?

get azure subscription belongs to what type for example Pay As you Go, MCA, EA, CSP

I tried to fetch azure subscription belongs to what type for example Pay As you Go, MCA, EA, CSP by using REST API But I am not able to find the appropriate API for this case.
I used Consumption Usage Details API, from this API response I am getting kind as Legacy or Modern
Is there any Rest API for this?
It's not possible to get the Offer Types from any API's, But you can get the offerId from the Consumption Usage Details API.
So, After you get offerId (for example "offerId" : "MS-AZR-0003P") , then you can take just the offerId number (i.e. 0003P). And refer it here to check what type of Offer it is (in this case its Pay-As-You-Go).

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 !

azure billing rate card api returns noting

I am trying to call the Azure billing rate card api. The call is happening successfully after the authentication because the status code is OK. But though I have a vm in the corresponding resource group and subscription, always getting response as:
{"value":[]}
Same is happening in case of azure billing usage api. I had seen one question asked for billing usage api but I have tried all the options mentioned like keep the duration for 3 months, don’t keep future date etc, yet there is no response”:
{"value":[],
nextLink:”https://….”}
Please let me know the issue could be abd because of which both rate card and usage api are not returning right data.
Thanks
You were right, I had the same problem and i resolved it on giving 'reader' persmission on my servie account in my subscription .
Thx a lot !

Resources