Google analitycs API. Get data by xmla - google-analytics-api

Whether there is a possibility of obtaining data and metadata via xmla?
I want to connect to xmla server via olap4j and visualize data from google.

Google analytics v3 returns Json not xml. No way to change that.
If successful, this request returns a response body with the JSON
structure defined below. If the output parameter is set to dataTable
then the request returns a response body with the JSON (Data Table)
structure defined below.

Related

Copy Activity Not able to copy any response from Rest api in Azure Data factory

I am using input as rest api url .And I am trying to save the response to a sql table.When I run the pipeline the pipeline run successfully,But it is showing zero rows copied.
I tested the api in postman.I am able to see the reponse data (9 mb)
Anybody else got this same issue,Please help me
I tried to reproduce and faced similar problem Its not inserting any records.
The problem is causing due to API returns response in Json and pipeline doesn't know which object value should store in which column.
To resolve this use Mapping. import the scma and amp the paricular columns as below:
Output:
I think the intend here is copy the response json to SQL and if thats the case then we cannot do that with copy activity .
One way is you can use a web activity to call the API and after that you can call a Stored proc activity and pass the response as a input paramter to the SP . The SP will insert the record in the table . But 9MB of response is too big , i doubt if the web activity can handle that .

GET works in Postman, but not in python. Python cannot read full data, only metadata returned

I am trying to run queries in our ERP system to collect large sums of data. I can access our Epicor queries via REST API V2. I'm troubleshooting in Postman with the goal of having Python automate the data collection.
My header in Postman contains my basic HTTPS authentication and API key. I'm using the suffix /Data to show the data from this specific query.
API call in postman using basic HTTPs authentication (username/pass) and API key in the header.
However, in python I can't figure out how to extract the same data. I've tried the API HTTPS address with /?api-key=" "/Data?, but it only returns the metadata of the query. I believe this is a syntax issue within python that I'm missing because it clearly works in postman.
How to I correctly call this API in python to extract the full data and not just the metadata? Image of metadata returned by Python (removed "/Data?" from query)
Note that no combination of suffix (i.e. /Data?, &metadata#data) works in Python. It only returns the metadata, and nothing else.

REST API Pagination in Azure Data Factory

I have a project scenario to get all values from an endpoint URL. I am using ADF Pipeline but I'm having some issues with pagination.
To get the following values, I need to make requests with the PaginationCursor value in the current body response in the following request header.
I have read that ADF supports the following case, which would be mine.
Next request’s header = property value in current response body ADF - Pagination support
I don't know how to use the following attributes in order to use the paginationCursor value from the current response body in the header of the next request.
Attributes for pagination in ADF
I tried to reproduce above but not successful. Instead, if you want to do it without pagination, you can try this approach.
First create a web activity with any page URL of your API to get the total number of pages count.
In ForEach create an array for page numbers using the count from web activity as
#range(1,activity('Web1').output.total_pages)
Inside ForEach use the copy activity and give the source REST dataset parameter for the page number like ?page=#{item()}.
In the sink dataset also, create a dataset for each page with the dataset parameter value like APIdataset#{item()}.csv. This generates the sink dataset names like APIdataset1.csv, APIdataset2.csv,...
Now, you can copy from your REST API without pagination.
My repro for your reference:
Copy activity:
I could solve this problem with the following attributes.
Solution
In the Headers I had to put the name of the header of the next call. In my case the name is PaginationCursor and I got the value of this header from the actual body response called paginationCursor.

Using JMeter, how to compare table data with JSON data?

I've got a task to compare all data fetched from postgreSQL table and all data located on a website that uses REST API (HTTP request with JSON data) in order to see which is missing.
I fetch data from postgreSQL using JDBC request (SELECT * FROM exampleTable), data is in standard SQL table format.
And I get REST API data using HTTP request sampler, data is in JSON format:
{"records":[{"id":"rec6iT8M0YFZc9kxf","fields":{"Birthday":"2010-09-01","Gender":"Female","Currently In Pasture":["rec7hRbjrgTaKWdCs"],"Breed":"Jersey","Weight":1800,"Name":"Jerri","Attachments":[{"id":"attbz","url":"https://IaGSYtK8SlS.jpg","filename":"Jersey_cow.jpg","size":1555316,"type":"image/jpeg","thumbnails":{"small":{"url":"https://_Jersey_cow.jpg","width":27,"height":36},"large":{"url":"https://dl/S4tl79.jpg","width":256,"height":341}}}]}
etc etc
both requests should have the same format of data (same "columns" for comparison > name, gender, breed, weight, etc)
I've tried using JSON Extractor post processor element to get individual variables from HTTP response and compare them to individual variables from JDBC request using the Response Assertion element but with no luck
I either get this error: Assertion failure message: java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.lang.String (probably cause I am using the whole SQL data set instead of data from individual columns)
or something like:
Assertion failure message: Test failed: text expected to match /${gender}/
I dont know how to successfully assign variables to data from SQL table and JSON response and then matching those variable values (seeing which entries are absent from what REST API fetches)
is there any easy way to do this using jmeter GUI and not having to rely on beanshell/groovy or any other kind of scripting (so just by using the elements available in jmeter) ?
thank you!
Not knowing your database structure it is quite tricky to come up with exact solution, however you can convert JDBC Request output into a JSON using JSR223 PostProcessor
Example:
Given the following JDBC Request sampler configuration:
Which produces the following output:
I can convert it into JSON using the following Groovy code:
def result = vars.getObject('result')
def json = new groovy.json.JsonBuilder(result).toPrettyString()
log.info(json)
as you can see it contains column names along with the values, you should be able to use it for assertions.
More information: Debugging JDBC Sampler Results in JMeter

How to compare XQuery output with databasein SOAP UI

I have written Xquery assertion in SOAP UI request its working fine. But i want to compare output of this with database. Can I add code to get the values from database in Expected panel of XQuery assertion of SOAP UI. If not is there any way where I can compare the xml response of a request with column values of a database
You can do it the following way:
Call a service with a Soap request
Make a property transfer from the service response to a test case variable, see the SoapUI docs for more information. You can use XPath or XQuery. See the picture bellow.
Make a JDBC request to your database and compare the results with the data stored in your test case variable.
This way is intuitive and effective for simple comparissons, for complex tests I would choose Groovy scripting.