WSO2 DSS - odata filter did not work - wso2-data-services-server

I am using wso2 v6.3.0, the odata service is working, returning all records from a table, but the $filter=wdt_ID eq 8 did not work at all, it keeps on returning all the records! (even the $select did not work, it returns all the columns anyway).
screenshot of the issue

I'm answering my own question:
After days of trials & web searches, I found my careless mistakes. I type in the addition parameters as: .....?filter=wdt_ID eq 8 , missing out the $ sign !!
So, the correct syntax should be: .....?$filter=wdt_ID eq 8 !
The odata features works as documented, excellent wso2 !

Related

How to build a query that includes # and # in Twitter API v2?

I'm not very good at interpreting how to build a query= with multiple operators. The below examples of attempts that are invalid for the Twitter API v2 . Can someone show me how to make a proper query with multiple operators using the Tweet Count API?
Attempts (title: 'Invalid Request',
detail: 'One or more parameters to your request was invalid.',):
https://api.twitter.com/2/tweets/counts/recent?query=#animals OR #animals
https://api.twitter.com/2/tweets/counts/recent?query=(#animals OR #animals)
Working (would like to combine these):
https://api.twitter.com/2/tweets/counts/recent?query=#animals
https://api.twitter.com/2/tweets/counts/recent?query=#animals
Figured it out. It appears Twitter v2 API requires encoded # (%23), spaces (%20), and # (%40). The below query is valid:
https://api.twitter.com/2/tweets/counts/recent?query=%23animals%20OR%20%40animals

Google Analytics Data API - way to small values or missing data

Has anyone tried the new Google Analytics Data Api (still in beta) for a GA4-Property?
We did this, the way it is recommended in the docs here: https://developers.google.com/analytics/devguides/reporting/data/v1/quickstart-client-libraries
Connection and authorization is working fine, but the values that are responded are way to small. For example it reported activeUsers for last 7 days as 50...but Analyitcs GUI has about 20.000...same as our old UA-Property that runs parallel. And the old reporting Api has the correct numbers...
We did it exactly like the reference example...
client = BetaAnalyticsDataClient()
request = RunReportRequest(
property="properties/{0}".format(self.property),
dimensions=[Dimension(name="defaultChannelGrouping")],
metrics=[Metric(name="activeUsers")],
date_ranges=[DateRange(start_date="7daysAgo", end_date="today")],
)
response = client.run_report(request)
print("Report result:")
for row in response.rows:
print(row.dimension_values[0].value, row.metric_values[0].value)
This gives me:
Organic Search 34
Paid Search 19
Direct 6
Referral 3
Email 1
So "organic" for example should be around 20.000!
Funny thing is even the Query Explorer App (https://ga-dev-tools.web.app/query-explorer/) is showing these low numbers for the GA4-Property...
Any ideas what could be wrong? Thanks!

Kronos API v2 - including multiple query parameters in a request

I am trying to access the Time Entries object via the Kronos API v2.
The documentation says that there are two required Query Parameters: start_date and end_date.
I am able to query the endpoint including one of the parameters at a time but am not able to enter both. And, I find the documentation quite lacking.
The root of the endpoint is:
https://secure.saashr.com/ta/rest/v2/companies/{cid}/time-entries
Here are things I have tried to suffix to the above endpoint:
?start_date=2019-11-01&end_date=2019-12-01
?start_date=2019-11-01|end_date=2019-12-01
?start_date=2019-11-01 end_date=2019-12-01
?start_date=2019-11-01?end_date=2019-12-01
?start_date=2019-11-01:end_date=2019-12-01
?filter=start_date:=:2019-11-01|end_date:=:2019-12-01
I also tried including quotes around the dates.
Everything results in some 400 level error when querying the API. With most of the above suffixes, it recognizes start_date but not the end_date. In this case, the error is:
{'code': 400, 'message': 'Missing required: end_date'}]
Note, above {cid} is replaced with the company's id.
In summary, how should I include two query parameters in the Kronos API?
The first option is correct.
https://secure.saashr.com/ta/rest/v2/companies/{cid}/time-entries?start_date=2019-11-01&end_date=2019-12-01
should work just fine.
Could you provide full URL you set in request?

Outlook API - Getting Error BadRequest when using filter with OrderBy

I am building a test application to fetch mail and attachments.
If I use the request, which includes a filter of IsRead=false and HasAttachments=true, it works
https://outlook.office365.com/api/v1.0/me/messages/?$select=Sender,Subject&$filter=IsRead%20eq%20false%20AND%20HasAttachments%20eq%20true&$top=50
If I use the request, whereby I have added an OrderBy and removed the second filter HasAttachements, it works.
https://outlook.office365.com/api/v1.0/me/messages/?$select=Sender,Subject&$filter=IsRead%20eq%20false&$orderby=Subject%20desc&$top=50
If I use the request to include both filters and orderBy
https://outlook.office365.com/api/v1.0/me/messages/?$select=Sender,Subject&$filter=IsRead%20eq%20false%20AND%20HasAttachments%20eq%20true&$orderby=Subject%20desc&$top=50
it breaks with the following error
request.Result = {StatusCode: 400, ReasonPhrase: 'Bad Request', Version: 1.1
can anyone see what I am doing wrong from the requests I am making?
Thanks in advance
From testing different scenarios the problem does seem to be with the filter HasAttachments
just HasAttachments filter with orderBy breaks
https://outlook.office365.com/api/v1.0/me/messages/?$select=Sender,Subject&$filter=HasAttachments%20eq%20true&$orderby=Subject%20desc&$top=50
just HasAttachments filter without orderBy works
https://outlook.office365.com/api/v1.0/me/messages/?$select=Sender,Subject&$filter=HasAttachments%20eq%20true&$top=50 works
using 2 filters with orderBy (NOT HasAttachments) works
https://outlook.office365.com/api/v1.0/me/messages/?$select=Sender,Subject&$filter=IsRead%20eq%20false%20AND%20Subject%20eq%20%27Test%27&$orderby=Subject%20desc&$top=50
By running the request in the browser I get a much more detailed error
{"error":{"code":"InefficientFilter","message":"The restriction or sort order is too complex for this operation."}}
So it appears that using a combination of some filters and sorting together are not allowed.
The way I would have to solve my problem is to include HasAttachments in my select clause and then filter the results returned.

linkedin api update comment count null

We run a daily job to pick up data from LinkedIn's api and noticed a change today in the values we receive back. They are both actually 0 but one comes back as null now and another comes in as 0 as before.
Update: Timestamp: 2017-03-28T19:31:25.281Z, UpdateKey: UPDATE-xxxxxxxx , UpdateType: CMPY
NumLikes: 1 , UpdateComments: Total: 0
Update: Timestamp: 2017-03-27T18:37:12Z, UpdateKey: UPDATE-xxxxy , UpdateType: CMPY
NumLikes: 0 , UpdateComments: null
Does LinkedIn change their data returns often? Is this something to be expected? Anyone else running into this today? I'm concerned that there may be something happening on LinkedIn's end that may cause us to receive null values when it should return something other than 0.
Thanks!
Since the beginning of 2017 there are changes in the Linked In API.
See: http://www.oodlestechnologies.com/blogs/Recent-changes-in-LinkedIn-API
and https://cloud.c2m.net/linkedin/linkedin-api
Another posibility could be a rejection due to trying to access the data from an App or a desktop application, in such case, just add
?allowUnsupportedBrowser=true
to your POST request.

Resources