What validation does Watson Tone Analyzer have for version query parameter? - ibm-cloud

I am using the POST API for Watson Tone Analyzer. The version query parameter is required.
https://gateway.watsonplatform.net/tone-analyzer/api/v3/tone?version=2016-05-19
This version is in the form yyyy-mm-dd. If a future date is given the API does not throw any error. Also, if 2016-09-1234 is given it still works fine instead of throwing an error. It also gives a 200OK if any random date in the correct format is given. But, if a date 2016-06 is given, it gives a bad request error.
What validation is applied by Tone Analyzer Service on the version???

When there is any changes to the API, they release a new, dated version. The value for the version parameter is the date for the version of the API that you want to call. The current version is 2016-05-19. Check out the Release notes for the changelog of available versions.
Please check out Versioning section in https://github.com/watson-developer-cloud/api-guidelines#versioning to understand more about it.

Related

How do I use Azure Devops TFS REST API to get older TestRuns of a TestPoint/TestCase/TestSuite?

The API call:
https://dev.azure.com/{organization}/{project}/_apis/test/Plans/{planId}/Suites/{suiteId}/points?api-version=7.0
Returns JSON data with objects "LastTestRun" and "LastTestResult" that contain their Ids. I am trying to find a proper way of getting older (not last) data of TestResults of the given TestPoint using API calls.
I tried the following API call:
https://dev.azure.com/{organization}/{project}/_apis/test/runs?planId=123
That returns me a list of all TestRuns in the given TestPlan. I can loop through the list and make API call for every single TestRun:
https://dev.azure.com/{organization}/{project}/_apis/test/Runs/{runId}/results
And, then retrieve the TestPointId. The problem is I'm working with large amounts of data, so I'm looping through 7000 API calls and it takes too much time (parallel of course).
I tried calling the last API call with $select so I can retrieve only the TestPointId but it is not supported.
A version of the AzureDevops I am working with: Version Azure DevOps Server 2020 Update 1.2.
Based on your expectation, I have tested as well to get test results with only test point value and tested get the runs of a specific test case in a test suite. Neither succeeded.
Currently there seemed no official API support the test point filter. For this, you may access this URL: https://aka.ms/AzDevOpsIdeas to submit any comments and proposals for future releases and implementations.

Where are the methods specified that are needed to analyse an Analytics Data API V1 Beta report?

I have added GTM and GA4 to some website apps to produce tables of detailed stats on click-throughs of ads per advertiser for a date range. I now have suitable reports working successfully using Data Studio, but my attempts to do the same using the PHP implementation of Analytics Data API V1 Beta (in order to do batch runs covering many date ranges) repeatedly hit a brick wall: the methods needed to analyse the response from instantiating BetaAnalyticsDataClient and then invoking runPivotReport or batchRunReports or batchRunPivotReports (and so on) appear not be specified.
The only example that I could work from is the ‘quickstart’ one that does a basic dimension and metric retrieval, and even this employs:
getRows()
getDimensionValues()
getValue()
getMetricValues
that do not appear in the API documentation, at least that I can find.
The JSON response format for each report is of course documented: for example the output from running runPivotReport is documented as an instantiation of runPivotReportResponse.
But nowhere can I find a specification of the methods to be used to traverse the JSON tree (vide getDimensionValues() above) and extract some output data.
Guesswork has taken me part way, but purely for example, when retrieving pivot data, should a
getPivotDimensionHeaders()[0]
be followed by a
getDimensionValues()
or a
getPivotDimensionValues()
I am obviously approaching this all wrong, but what should I do, please?

How to find out whether Google storage object is live or noncurrent?

Google Storage documentation tells about Object Versioning. There are two kinds of the object versions: live and noncurrent.
gsutil allow listing both noncurrent and live versions using -a switch: https://cloud.google.com/storage/docs/using-object-versioning#list.
Also, I can list all the versions programmatically by supplying versions: true option to the Bucket.getFiles method.
However I have not found any way to programmatically find out whether a particular object version is live or noncurrent. There seems to be no property or method in the File object for this.
What is the proper way of finding this out given a File instance?
By looking at the REST API, there isn't a state for the live/noncurrent version of the objects. You have a generation number per object resource representation.
I assume that you have to apply yourselves an algorithm for this
Use List API (getFiles) on a single object with the version option to true
The highest generation is the live version, others are noncurrent
Except is timeDeleted is populated on the highest generation (timestamp of the live version deletion). Therefore all the version are noncurrent.

Maximo REST query parameter _uw

Can anyone provide me with an example of a REST call using the query parameter _uw? What is the syntax?
Not sure as to which version of Maximo you may be running, but if you are on 7.6.0.2 or higher, I would very much recommend using the newer JSON API, as you can create saved queries and execute them or use the updated oslc.where parameter. You can find that documentation here.
However, if that is not an option the _uw parameter is fairly similar to a where clause in the Maximo UI. There are a few caveats simply because of the fact that it needs to be entered in the URL and therefore should be URL safe.
Example
<your maximo server>/maxrest/rest/os/mxwo?_uw=wonum IN ('1000','1001')
Keep in mind URL encoding will likely be necessary if you are making this request outside of the browser.

Setting id to task using Google Task API returns 400 invalid value

I am using Google's Java API for an project.
Strangely, inserting a task without setting an id works fine. However, inserting a task with a id returns a 400 invalid value error. The id is to be used for syncing local data with Google Tasks
I'm pretty sure there's nothing wrong with the algorithm that generates the ids for the task. The same algorithm works perfectly for Google Calendar API.
Am I missing something here?
You may refer with this SO answer. It suggested to pass the id key/value pair together with the title information you are already sending. There's no documentation to indicate this is a required parameter, especially since it is included in the URL. Google requires the id of the task to be passed as a part of url, parameters and body.