Where is the documentation for the Google Analytics API JavaScript client library? - google-analytics-api

I have spent days looking for proper comprehensive documentation for the JavaScript client library for the Google Analytics API. The only bits I could find was this page: https://developers.google.com/analytics/devguides/reporting/core/v4/rest/ which has all of ~20 completely uninformative words on the page, and https://developers.google.com/analytics/devguides/reporting/core/v4/quickstart/web-js, which does have some actual JavaScript, but nothing like documentation. It just illustrates two or three functions using the client API.
Is there nowhere that they actually list the full API? How are we supposed to know what functionality is available?!
Then there are the pages in this section: https://developers.google.com/analytics/devguides/reporting/core/v4/basics#request_body which list a lot of query samples, but don't explain how to use any of this in a client library. Is there any practical information on how to get started with accessing the Analytics API anywhere?
Thanks

The Analytics API is language agnostic, the google js client library docs apply to all of Google's APIs. Every client libarary is built around the discovery service API which describes the entirety of whats is available.
V3 API discovery call
Analytics Reporting Discovery call
How to use a client library is centrally documented and applies to every Google API.
Analytics Specific
There are lots of languages and client libraries and the Analytics API team cannot support every language. Instead they make available comprehensive reference docs which describe what endpoints are available. Once you learn how to use a particular client library calling the individual API endpoints happen in the same why.
That being said every endpoint they have is documented in JS.
The Analytics Mangement API is well documented in JavaScript. the Open source Google deomos and tools is built with it.
The Analytics Reporting API Samples page has documentated examples in JavaScript. You even linked to a Quickstart guide which should help you understand how to use the client library.
Can you expound more on what you'd expect in terms of documentation?
Final tip
If you load the analytics client library
gapi.client.load('analytics', 'v3').then(...)
In the chrome console you can then just start playing with it dynamically:
gapi.client.analytics.managment.[hit tab]
will list all the management API methods available.

Related

APPDYNAMICS Public Rest APIs info

I'm new to APPDYNAMCS and looking for APPDYNAMICS Public Rest APIs for the below data. I'm able to find out a few of them but not all. Can someone help me with this? Thanks in Advance
Looking for REST APIs for the below data.
1.Configuration Items( Business Application, servers, business service, etc) and relationship among them.
2.Service Map data.
3.Raw Event.
4.Alert data.
5.Raw Metrics.
6.Raw Logs.
7.Raw Traces.
8.SLO/SLI data.
9.Real User Monitoring / Synthetic Monitoring data
10.User sessions data
All currently available AppDynamics APIs are documented here: https://docs.appdynamics.com/display/PRO21/AppDynamics+APIs
The main page includes a summary of what is available.
While ingmar is technically correct, the documentation doesnt cover all the APIs available. There are undocumented APIs that even that AppDynamics utilities on github use.
There is a utility called AppDynamics command line tool which does a good job at documenting the APIs. The commands are listed in its commands.yml file.
Another source of API knowledge is my own rapport for appdynamics project in which I use some of these undocumented APIs after having figured out how the controller uses them.
good luck!

What framework Google, Microsoft, FB use to document their REST APIs

I am using Swagger for REST API documentation which is built using Spring Framework. I am looking for better alternatives where I don't need to define complex resources again and again in every API.
Like Google has a well-defined documentation Google Doc. What frameworks top IT companies using for it.
Well I have advised two of those companies to use OPTIONS.
OPTIONS data can be cached at runtime giving a custom APIDOC per each ROLE/AUTHORITY.
That way USER will not see ADMIN endpoints and you can create a dynamic APIDOC.

Why is ml-engine functions present in Google Client API library instead of Google Cloud client library?

https://cloud.google.com/ml-engine/docs/tutorials/python-guide says ml-engine library in present in Google Client API library. Since Google Cloud client library is tailor-made for cloud applications, it should have had it no?
The difference is that the client library is essentially autogenerated from REST API while the Google Cloud one is handwritten to follow idiomatic usage for each language. So, usually the client API has wider language coverage and is immediately available. The Cloud API for specific languages are created if there is sufficient need.
So, I guess what I am saying is that you should provide feedback to the cloudml team on which language you'd like Google Cloud API for ml-engine.

Writing an api-doc for Swagger

I'm trying to use the Swagger UI, and it says that I should begin by writing an api-doc that describes the exact api for a REST api. The problem is that I have no idea what this means. Is this document written in plain English? Or is there a certain format that will be able to generate the UI?
Thank you!
Swagger is a specification for describing REST APIs. Documentation of the specification can be found here - https://github.com/swagger-api/swagger-spec.
Generally, there are two ways to document your API. If you already have an existing API with code, you can use any of the existing libraries (https://github.com/swagger-api/swagger-spec#additional-libraries) to integrate into your code and generate documentation at run time. Some of those libraries also offer offline generation of such docs.
If you're looking to design an API, or would rather not integrate another library into your application, you can use https://github.com/swagger-api/swagger-editor either locally or with the online version - http://editor.swagger.io.
Once you have the documentation, you can use Swagger UI to visualize and test it.

Visual REST API playground

What are some web apps that allow me to play with any REST APIs visually (by clicking) and also get some code generated (in any language) that captures what I have described visually?
Similar to Swagger or Google API Playground but allows me to talk to anything that speaks REST (assuming I have the proper auth credentials and I know what messages it understands).
Bonus points for something that can also "discover" what messages are understood, given a URL endpoint.
Microsoft has 2 that I know of
OData API explorer
The data market service explorer (requires signing in, and then you can access free data sets)
Considering that REST API's are going to follow their own conventions, terms, and have their own documentation (hopefully), this is an impossible problem. If you restrict your quest to visualizing API's that follow a "standard" form of self-documentation (see REST web service WSDL? for some hopeful scenarios) you might be able to accomplish this.
Or you can use something like http://www.programmableweb.com/ to discover tutorials, tools, examples, and mashups of various existing APIs.
You could mock an API at http://apiary.io/.
You could explore and existing one through tools (e.g. REST Console for Chrome)
What you can't have, is one-size-fits-all explorer for "every possible REST API." Some APIs follow conventions that others don't.
apigee and apihub (now part of mulesoft) are two that I frequently visit. Of the two, apigee is my preferred provider.
One of the reasons that you're not going to see a lot of websites like this is because of the same-origin policy. This means that you can't access a RESTful API located at api.google.com from a web app running at, say, www.restfiddle.com without sending all the API traffic through restfiddle.com's servers. Sites like JSFiddle can exist (and are used widely) because all the processing is done on the client side.
Browser plugins, however, are exempt from the same-origin policy. If you're using Chrome, try Postman. If your REST client doesn't need to be web-based, check out SoapUI. IntelliJ IDEA has a nice REST client as well.
Try Restlet Studio, it's the only visual API designer I've found, and seems pretty good, it imports and exports swagger & RAML.
http://studio.restlet.com/