Connect API V2 ListCatalog - Filter by Location ID - http

In Connect API V1 to get the List of Items, we would pass location_id in the url to pass get the Catalog List for the specific location.
In V2, we only pass the access_token, to get the CatalogList, however we get we get the entire CatalogList for all the different locations if a merchant has multiple locations.
Is there a way to pull the Catalog List by location in V2? Otherwise, I would filter the response that is sent back from the API, and my concern would be that it could take a large amount of time upfront to filter the catalog.

You cannot filter your item catalog by location_id, as an item catalog is associated with an account, not a location. If you are concerned about the processing time, you could cache the list of ids associated with each location and just do BatchRetrieveCatalogObjects instead.
See the documentation for List Catalog for more details.

Related

How to retrieve child nodes data in firebase by php

How to retrieve child nodes data and update values in firebase:
As I want to make an API in which I create parameters to pass values by it.
Like example I have one node in firebase name as users and under it has user amount is 10. I want to get that data of amount from users node and add some value with it like 10+5 will update in database as 15 in my firebase.
I tried to retrieve data from firebase by seeing youtube, but I'm unable to get what I want; I was only able to get the whole users node data at whole.
That sounds like a 2-step process:
Store the value as a number rather than as a string like you now have it.
Then use the atomic increment operation to increment it by 5.

How to fetch email marketing insights data from Marketo using API?

I am trying to fetch "Email Performance Report" from the platform
using API to analyze the KPI's like CTR etc by type of the email
(newsletter,email marketing etc).
I went through the documentation, however I didn't find endpoint from
which I can fetch the same.
Does anyone know if there is a way to get this information?
There is no endpoint to query reports directly. However, the good news is, that the “things” that make up an “Email Performance Report”, namely: email delivery, bounce, open and click are available to query via the API.
This means that you have to build the report yourself, but you can fetch the dataset to work on.
These “things” are called activity types (activity measured on a Lead) and can be fetched by querying against the Get Lead Activities endpoint, which is also mentioned as the Query in the API docs.
It sits at the GET /rest/v1/activities.json url and you have to pass a nextPageToken and the activityTypeIds as query parameters.
The nextPageToken indicates a datetime. Activities after that date will be returned by the call. To obtain one, you have to make a call to GET /rest/v1/activities/pagingtoken.json, where you have to specify the earliest datetime to retrieve activities from. See more about Paging Tokens.
To figure out the value of activityTypeIds, you first need to get the internal Ids of the activity types you are interested in. In order to do so, you have to query the GET /rest/v1/activities/types.json endpoint and look for the activity types with names like Send Email, Email Delivered, Email Bounced, Unsubscribe Email, Open Email and Click Email. (I don't know if these Ids are changing from instance to instance, but in ours these are from #6 to #11).
Once you have all of these bits at hand, you can make your request like that:
GET https://<INSTANCE_ID>.mktorest.com/rest/v1/activities.json?activityTypeIds=<TYPE_ID>&nextPageToken=<NEXTPAGE_TOKEN>&access_token=<ACCESS_TOKEN>
The result it gives is an array with items like below. Items can be filtered to specific email based on the primaryAttributeValue property and processed further accordingly.
{
"id":7370416,
"marketoGUID":"7170506",
"leadId":291305,
"activityDate":"2017-12-17T00:00:00Z",
"activityTypeId":11,// #11 = `Click Email`
"campaignId":1790,
"primaryAttributeValueId":1638,
"primaryAttributeValue":"EMAIL_NAME",// Name of the Email as seen in Marketo
"attributes":[
// …
]
}

Get all real analytics data having condition 'custom:user_id="XYZ"'?

I tried to automate test to validate GA events.
My approach is :-
List item use google analytics real time reporting api.
Before the test ends i will hit this api and collect the last 30 mins data
This data will be a huge chunk of formattedJson string
and in this string i will search my GA events which was supposed to push.
This approach seems to be in-efficient.
My issue is to find the analytics data which corresponds to test user.
Each user has unique user id, hence, i am trying for making the request such that api returns me the filtered data based on some custom dimension "custom:user_id='user_unique_id'" .
Is it possible to get all data having condition e.g 'custom:user_id="XYZ"'.
Please advise, how to get all ga events data for a specific event label / custom dimension ? Also, does it support dimensionFilterClauses like reporting api v4 ?
We can do it by filtering.
e.g rt:eventCategory==ProductPage
earlier i was using quote, rt:eventCategory=='ProductPage' which wasn't supported.

Is it possible to fetch data from multiple Google Analytics tables in one request?

Looking at the API documentation linked below makes me confused. The parameter name "ids" suggest due to its plural form of "id" that I should be able to fetch data from multiple tables in one request, right?
However, this (vaguely) suggest the opposite:
The unique table ID used to retrieve the Analytics Report data. This ID is provided by the element for each entry in the account feed. This value is composed of the ga: namespace and the view (profile) ID of the web property.
https://developers.google.com/analytics/devguides/reporting/core/v2/gdataReferenceDataFeed#ids
What I want to do is fetch visitor data from more than one table in one request and get them summed up and ready to use.
Is this possible?
Thanks!
This is not possible. You will need to make 2 separate requests for each table ID.

ASP.net - Caching by Query-String (VaryByParam)

In which situations should we use Query-Strings (VaryByParam) to achieve Caching in ASP.NET?
Can anyone give an example of a real-life situation in case of an web-application?
Products.aspx?productID=12345
Obviously you don't want the output cache of Products.aspx to have the data for the first product that got requested.
In detail
If I hit Products.aspx?productID=12345 the page will be processed for me, look up the info for product 12345, and cache the results. Then you hit Products.aspx?productID=54321, the page will not be processed for you but products.aspx will be retrieved from the output cache and you'll see the info for 12345. Not good. VaryByParam resolves this.
The most classic example may be: A product catalog
It may have a URL structure like so:
http://www.myshop.com/Catalog/ViewAllProducts.aspx
http://www.myshop.com/Catalog/ViewAllProducts.aspx?PageNum=123&PageSize=50
http://www.myshop.com/Catalog/ViewProduct.aspx?ProductID=12345
The first URL is the complete list of all products. There's no querystring here, but the second URL is the same page but with pagination. The Page Number (PageNum) and the number of items per page (PageSize) are both querystrings, so assuming the user couldn't re-order the product list, two different users requesting the:
http://www.myshop.com/Catalog/ViewAllProducts.aspx?PageNum=123&PageSize=50
URL would be getting the same information. The first request could cache this data so that the second request at a later time doesn't need to go back to the database to get the product items (and the details related to them: price, description etc.) in order to display them.
The third URL is a single product detail screen with the Product ID (which could be a unique identifier from the database) as it's single querystring parameter. Multiple requests for this will almost always need to return the same data (unless the price or description or some other element of that specific product changes on a frequent basis). Caching based upon the "ProductID" querystring (and it's variations in value for different products) will greatly reduce load of the database. Ensuring the cache duration isn't too long will ensure that the cache is expired in a reasonable time should the actual back-end database data change.

Resources