WSO2 API Manager - Generating usage reports - wso2

We are using WSO2 API Manager 2.0.0 along with WSO2 DAS 2.0.0 standalone versions
Requirement : Generate API usage report for a user for a particular time period
How do we achieve this?
we could see following data in publisher statistics. API usage graph for users(user wise split available,no option to filter based on time period) and API usage graph which covers all users(can filter based on time period but no user wise split available).
TIA

You can get API Usage graph based on a particular user as mentioned in [1] and the time period either Day/Week/Month only. In the current implementation time period for hourly can not be generated.
When you get the API usage graph for all users it filters for a particular time specified for all the users(publishers) under the same tenant.
[1] http://rukspot.com/wso2_apim_statistics_model.html

Related

Authorize.Net Query on recurring billing

We have been trying to integrate authorize.net payment gateway in one of our clients project based on Asp.net web API. We have few queries that we came across while implementing Recurring Planning scenarios.
Query 1
We checked the API’s for Creating Subscription, Getting Subscription, Updating Subscription. However once we have created subscription, is there any way we can update the amount in the subscription.
Let’s say for example.
We have a created a subscription for our user for 50$ amount on 01st Jan 2021 with 30 days interval.
And on 15th Jan 2021, our user wishes to purchase 1 more license which will cost him 10$ more.
Hence can we increase his billing cycle of subscription by updating the subscription?
We checked in Update Subscription API, & it is only allowing to update credit card info hence is there any way to update amount.
Query 2
Is there any way to implement Autorenewal, hence when a user wishes he/she can set auto renewal on/off for recurring billing.
Query 3
If there is any way to switch off auto renewal of recurring billing, then is there any link that we can generate & send them through which they can pay there next due.
Query 1: You cannot update a subscription amount. If the amount needs to change you either need to cancel the current subscription and create a new one for the new amount (being sure to prorate credit from the previous subscription payment) or use CIM to manage your subscription service which allows you to charge against their card at your discretion but requires you to also manage the subscription yourself.
Query 2: Not through Authorize.Net. If you want a subscription to start or end you need to explicitly do so through their API.
Query 3: Not through Authorize.Net. That application logic and, once again, you would be responsible for managing.
I'm assuming you are using or are aware of the API provided for Authorize.net here: https://github.com/AuthorizeNet/sdk-dotnet/tree/master/Authorize.NET/Api/Controllers
Query 1: As of now, there is a way to update the amount for a given subscription. You can use ARBSubscriptionType class. There is an amount property there you can set. Then you can create the request ARBUpdateSubscriptionRequest, passing in the ARBSubscriptionType class and the subscription Id.
Note: You might have to handle pro-rating.
Query 2: There isn't a built in renewal feature in Authorize.Net as far as I know. It seems like you could potentially update the totalOccurrences by some amount to act as a "renewal", when technically its an extension of the subscription. The method in which you check when to update, either a Modulo operation or a date check is up to you. You can use paymentScheduleType class to update totalOccurrences, passing it along to a ARBUpdateSubscriptionRequest.
Query 3: Authorize.Net does not have any in house link generation.

Amazon AWS - Get FBA Orders

I'm trying to get all FBA orders from Amazon. The feed I'm currently using is the RequestReport with the report type as “_GET_FLAT_FILE_ORDERS_DATA_"” -
From reading the documentation would I be correct in assuming there is no official way to distinguish between FBA and manufacturer fulfilled orders on this report?
The only way I can see to do this would be to change the program to stop requesting a report and instead request the ListOrders feed which allows filtering on the Fulfillment Channel?
I contacted Amazon AWS Support and got the answer I needed
_GET_FLAT_FILE_ORDERS_DATA_ report type will return only Merchant Fulfillment Orders. If you want a report type to see all the orders
along with FBA orders you can use All order reports. Below is the
documentation for All Order reports. Please note that All order
reports are only for tracking purpose.
http://docs.developer.amazonservices.com/en_UK/reports/Reports_ReportType.html#ReportTypeCategories__OrderTrackingReports

How to display all products without using ListMatchingProducts in the Amazon MWS Products API?

I have integrated the MWS API for my store. The issue is I was not able to get list of all products which I have submitted from feeds and also available products in Amazon store in account.
I have tried all the api of MWS no any api giving all products.
In Listmatchingproducts api it needs query parameter but for product listing there should not be query parameter required.
So for all product listing which api will be used and how?
In order for you to retrieve all of your products without input parameters, you can use the Reports API to request an inventory report or active listings reports or any of the report types here: http://docs.developer.amazonservices.com/en_US/reports/Reports_ReportType.html#ReportTypeCategories__ListingsReports
You can call the Reports API just like the Products API, but there are extra steps involved. You first request the report using the RequestReport operation, then you'll get back a GeneratedReportId. Take that Id and call the GetReport operation and you'll get back the report once it's available. If you need more than a report, but need to work with the data in some other way, you can just write a routine in whatever language you're using to parse out the data in memory.
Have you seen the client libraries? They do most of the work already, just plug in your keys. https://developer.amazonservices.com/gp/mws/api.html/188-4747010-1589520?ie=UTF8&group=bde&section=reports&version=latest
Basically there is no specific API to call the product list available in your store. But you can get your products using Reports API (ReportType enumeration)
http://docs.developer.amazonservices.com/en_US/reports/Reports_ReportType.html#ReportTypeCategories__ListingsReports
There is multiple steps involve in order to work with reports.Here is the steps that involve to get the product listing.
1-RequestReport
2-GetReportRequestList (includes the ReportId when done)
3-GetReport
Have you tried Scratchpad. its for UK marketplace.
https://mws.amazonservices.co.uk/scratchpad/index.html

Facebook Marketing API limits

I use marketing fb graph API through my fb app with developer level access. I need to basically get all data (info about campaigns, ad sets, stats, and so on) as often as possible. There are some limits and I'm reaching them pretty quickly calling graph marketing API. After a few hundred calls I'm stuck with err #17 - request limit reached.
My questions are:
is it possible and how to increase the limit
what's the efficient way of getting all data. I'm mostly interested in tracking changes (smth has been added/ updated/ deleted and stats), but first of course I need to gather all my marketing account data somehow.
Requesting each object for it's info / stats is going to hurt after a while. If you need detailed stats about engagement, social reach, impressions and such, you have a couple options:
The /reportstats endpoint is available for most objects and overs aggregation filters, specificity, column selecting and other useful things and can also be called to asynchronously generate a stats report for all of the objects you requests. This can even be done on an account level. You could easily retrieve a low-level aggregation of delivery stats for the entire tree of objects in your account or campaign.
Another more recent development in their API is the Insights endpoint, which is a centralized endpoint for retrieving stats as well and operates more like the rest of the graph API (request field names, filtering, preset, etc).
I recommend reading up on each for retrieving delivery stats for your ads api objects.
Additionally, if you're looking for the objects' attributes themselves, there are a couple options. The most useful one may be that you can request the graph api with no endpoint and a list of object ids in the params. The request would look like this graph.facebook.com/?ids=000000000. Furthermore, you can use facebook's fields query parameter to return attributes about that object. But, wait; there's more. Facebook's graph api offers field expansion for connected objects through this same query parameter. That is to say, you could request all campaigns' attributes, all ad sets' names and all ad sets' ads' names like so:
curl -G \
-d 'ids=00000000,111111111' \ # ids of campaigns
-d 'fields=name,adcampaigns.limit(50).fields(name),adgroups.limit(50).fields(name)' \
-d 'access_token=xxxxxxxxxx' \
https://graph.facebook.com/v2.4

Any way to find out my Amazon Product API Limits

I was given an Amazon awsAccessKeyId and awsSecretKey,
also our company has affiliated with Amazon, we get a Associate Tag​.
And I was told we may get higher API limits, because we are affiliated.
But I don't have any detailed info about the API limits,
I want to know how many calls i can make in a second
Is there any way I could check our API Key status?
The call i use will be check product info like:
Service=AWSECommerceService
&Operation=ItemLookup&ItemId=[ID]
&IdType=ASIN
.....
When you exceed the requests limit, Amazon Product Advertising API sends a (possibly gzipped) response with 503 status code. Example response for ItemLookup query:
<?xml version="1.0"?>
<ItemLookupErrorResponse xmlns="http://ecs.amazonaws.com/doc/2013-08-01/">
<Error>
<Code>RequestThrottled</Code>
<Message>AWS Access Key ID: YOUR-AWS-ACCESS-KEY-ID. You are submitting requests too quickly. Please retry your requests at a slower rate.</Message>
</Error>
<RequestId>fabebd87-54a2-44ec-b547-deb5feee900a</RequestId>
</ItemLookupErrorResponse>
The rules have changed since #at0mzk's answer.
You have to make sales to use the API. The limits are set by sales in the last 30 days.
Effective 23-Jan-2019, the usage limit for each account is calculated based on revenue performance attributed to calls (also called requests) to the Product Advertising API (PA API) during your account’s latest 30-day trailing period.
Each account used for Product Advertising API is allowed an initial usage limit up to a maximum of 1 request per second and a cumulative daily maximum of 8640 requests per day (TPD) for the first 30-day period after your account has been approved. Following that period, your PA API usage limit will solely be based on your shipped item revenue. Your account will earn a usage limit of 1 TPD for every 5 cents or 1 TPS (up to a maximum of 10 TPS) for every $4320 of shipped item revenue generated via the use of Product Advertising API for shipments in the previous 30-day period.
Docs
Apparently there's not way of checking exactly what those limits are and they will change based on the performance of your account.
It seems that the minimum rate limits are:
1 request per second
8640 requests per day
Those limits will increase if your account has a good performance (as in shipped items revenue) using the API links.
From: Amazon Product API - Troubleshooting
API Rates
Curious to know how we provision API call rates for Product Advertising API 5.0? First, some definitions:
TPS – Transactions per second, refers to the maximum number of API calls you can make in one second. Each API call counts as one transaction. For example, if you send 10 ASINs in the request parameter of a GetItems() call, it counts as a single transaction.
TPD – Transactions per day, refers to the maximum number of API calls you can make in one day. If Associate has 1 TPS and 8640 TPD, then maximum of 1 request can be sent per second and 8640 per day. Even if 1 TPS is there, once TPD is exhausted requests will be throttled.
Primary Account – This refers to the Amazon username (email address) and password that you used to create your Associates account and used to generate Product Advertising API 5.0 credentials.
Shipped revenue – This refers to the total sales volume of all items Amazon has shipped from orders resulting from clicks through links you created using Product Advertising API 5.0.
Also:
As soon as you create your Product Advertising API 5.0 credentials, you are allowed an initial usage limit up to a maximum of one request per second (one TPS) and a cumulative daily maximum of 8640 requests per day (8640 TPD) for the first 30-day period. This will help you begin your integration with the API, test it out, and start building links and referring products to your readers.
Your PA API usage limit will be adjusted based on your shipped item revenue. Your account will earn a usage limit of one TPD for every five cents or one TPS (up to a maximum of ten TPS) for every $4320 of shipped item revenue generated via the use of Product Advertising API 5.0 for shipments in the previous 30-day period. For correct attribution of shipped item revenue please ensure that you always call Product Advertising API 5.0 with the primary account credentials and retain all the URL parameters that the API returns in its response.
...
If you are trying to submit requests that exceed your account’s usage limit, or if your access has been revoked you will receive a 429 TooManyRequests error message from Product Advertising API 5.0. Please refer our API integration best practices to learn more on how to avoid these situations and optimally access the API.