YouTube Reporting API: Create/Download reports using channel oauth token - api

We have a channel oauth token from a channel owner and we are able to use the YouTube Analytics API to get details, including revenue, on the channel/videos.
I would like to use the YouTube Reporting API to create a report that we need daily and not use the more resource limited Analytics API but I am not able to see the larger list (43) of report types that include system managed reports with revenue, such as content_owner_ad_revenue_raw_a1 and content_owner_estimated_revenue_a1 with any value for the onBehalfOfContentOwner argument in a service.reportTypes().list API call.
I can see a list of 43 available reports when using a CMS oauth token, passing the partner_id value as the onBehalfOfContentOwner.
I can not find a working value when using a channel oauth token, any value I tried (oid for the video for example) results in an error response.
When I use None as the value for onBehalfOfContentOwner I see a different list (for both cms and channel oauth) of 18 reports that do not include any revenue data.
What value should I use with a channel oauth to get the revenue information from Reporting API, similar data that I am able to get from Analytics API using the same token?
Snippet from the list of 43 report types that I see when using cms partner_id on a CMS level is attached.
The list of 18 report types that I get when I pass None to onBehalfOfContentOwner is also attached (the same list for cms and channel oauth).
I tried the following:
service.reportTypes().list(
onBehalfOfContentOwner=oid,
includeSystemManaged=True
).execute()
returns error, any other value I could think of instead of oid returns error
with
service.reportTypes().list(
onBehalfOfContentOwner=None,
includeSystemManaged=True
).execute()
I get a list of 18 report types that doesn't include revenue information, also there is no systemManaged column.

Related

Can we get data as Response using Post Method for API Testing using RestAssured Cucumber

Here is the full question :
As a Portfolio API, I should be able to retrieve details for a given Account and Account type from Balance API, so that i can pass over the same to the UI for the end users to view the same.
Scenario 1 - Verify the response when Portfolio API invokes the
POST /v1/accDetails endpoint for a given account details (Checking)
Given client has a valid auth token for the api
And Portfolio API has the following
Account Number 1234567890 (10 characters).
Account Type 'CHQ' (3 characters)
When Portfolio API sends a POST request to Balance API
Then Portfolio API will receive the response code as <00>
And response body will have the following (not limited to below fields)
Account Type, Account Number, Account ID, Account Name, Account Balance, Product TypABA Number, Interest Rate, Interest Earned to DateStatus.
Now my question is we can do this using GET Method but can we do this using POST method or not? When we use post that mean we are going to add something but I do not want to add any account. I just want to get account details.
Since you have only a few parameters to send via GET, the best approach is to use [GET].
We can use the [POST] if we really need it to do so.
But if you can use [GET] for that, then the best approach is to use [GET].
Also can refer: REST API using POST instead of GET.

REST APIs to fetch statistic api usage data from API Connect

This may look a dumb question to you. However, I am looking for a way to fetch API Connect internal data i.e. number of invocations of APIs exposed via API Connect , by which client etc. I know, there are individual dashboard/chart within API Connect. But, I want to build a explicit tool to monitor the same leveraging API Connect data.
is it at all possible ?
Thanks in advance
See the KC at https://www.ibm.com/support/knowledgecenter/SSMNED_5.0.0/com.ibm.apic.apionprem.doc/rapim_analytics_apieventrecordfields.html which will explain how to get the info you want.
Procedure
To obtain analytics data for a Catalog and API provider organization, issue the following call:
GET /v1/orgs/{orgId}/environments/{envId}/events
where
{orgId} is either the URL path segment or the ID of the API provider organization.
{envId} is either the URL path segment or the ID of the Catalog.
The following example shows a call that is issued from a browser and then shows all the event fields in the corresponding response. The call is issued to return two analytics events (limit=2), and includes a next parameter for requesting further events.
https://api-manager-server.company.com/v1/orgs/macs-shack/environments/sb/events?next&limit=2

Get historical data using Instagram API endpoints.

I am trying to fetch data using the Instagram API endpoints. Steps that I have followed
1. Register the client app.
2. Got the access token.
3. I am using this access token through out the url endpoints.
Ex. to get the data for recent media I am using this url endpoint: https://api.instagram.com/v1/users/self/media/recent/?access_token=ACCESS-TOKEN
However as I am in Sandbox mode, as per the documentation I get only the recent 20 media. Whereas my account contains in total 291 media.
Problems that I am facing:
Not able to get next_url in the paginationpart.
Usage of min_id and max_id in the url does not respond to any changes in the output or the data i.e fetched (Still get only 20 records/media)
Ex: https://api.instagram.com/v1/users/self/media/recent?access_token=XXXXXX&min_id=xxxxxx_xxxxx&max_id=xxxxxxx_xxxxxxx
Can anybody provide a solution as to how exactly I should get all of my historical data ?
You're in the sandbox mode so there's no way to achieve what you're trying to do before your app has been reviewed and approved (and gone live). From Instagram API documentation:
After your app has been reviewed and approved, you are ready to make it available to the general public. To switch your client from sandbox to live mode, you can use the button on the top section of the configuration screen for your app. When you are live, any Instagram user will be able to authorize your app, but you will have access only to the permissions that you were granted during the review.
Well, maybe you should try this library that allows you to scrape public info withou auth (client_id or access_token): https://github.com/raiym/instagram-php-scraper
$medias = Instagram::getMedias('kevin', 150);

Soundcloud API not recognizing "Soundcloud Go" subscription

I just upgraded my account to the "Soundcloud Go" subscription and the API does not acknowledge the subscription:
Sample data from /Me endpoint
plan:"Free"
...
subscriptions:Array[0]
I gave it some time to refresh, I disconnected my account and re-connected it with a new access token with no different end result.
I was attempting to see if upgrading the account would allow greater access via the API as large portions of previously available data is now missing (for example I am only getting 42 of my "liked / favorited" items returned out of 62)

How to get the NetSuite account meta-data from the NetSuite API?

I have an analytics app where people can plug their NetSuite account. Ideally, I would also retrieve some meta-data about the NetSuite account itself (ex: company name, etc) to make the analytics results more readable.
Does the NetSuite SuiteTalk SOAP API offers the possibility to retrieve meta-data about the NetSuite account itself?
Yes, you can get most of the company information using Configuration APIs
var companyinfo = nlapiLoadConfiguration('companyinformation');
var companyName = companyInfo.getFieldValue('companyname');
For a list of complete available fields please read "Preference Names and IDs"
EDIT:
Since, in SuiteTalk API, there is no specific API to fetch company information. I would recommend to write a RESTlet using above code and then access it via HTTPS in your Analytics application. If your application has to support multiple NetSuite account you may want to bundle your RESTlet.
In case someone needed to get the Company name, took me days to figure out so im sharing. You can use the token information endpoint defined here https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/chapter_157017286140.html
Calling a token endpoint to obtain user information based on a token
The tokeninfo endpoint returns information about a user based on the access token. The endpoint is https://{accountID}.restlets.api.netsuite.com/rest/tokeninfo, where is a variable for the company’s account ID. A response to a GET request contains data in JSON format, including information such as: Company Name, Company ID (account ID), Role Name, Role ID, Entity ID
NetSuite provides a Roles service that contains some very limited metadata about the account (Name and ID). See the Help Document titled "Using the REST roles Service to Get User Accounts, Roles, and Domains".