How to escape asterisk character from Easy Redmine rest API Call - powershell

I want to escape asterisk(*) character from easy Redmine rest API URL.
I am trying to get the result based on given URL.
https://moksh.easyredmine.com/issues.xml?limit=100&tracker_id=4&project_id=109&subject=*ALERT* Sophos XG Firewall - Gateway status alert&sort=updated_on:desc
I want only those easy redmine issues where query string matches with api issue response.
But it is selecting all records and it is not filtering based on project and subject. I think asterisk is creating the problem. I am using PowerShell and POSTMAN to call the API.
Any help would be appreciated.

According to the documentation, the parameters sort, offset, limit and page are required.
You're not using offset and page.
You can switch to console on the documentation, and build an example with your value, which -using your values- leads to http://moksh.easyredmine.com/issues.xml?sort=updated_on%3Adesc%20&offset=0&limit=100&page=&tracker_id=4&project_id=109&subject=*ALERT*%20Sophos%20XG%20Firewall%20-%20Gateway%20status%20alert

Related

Provide array of URNs to LinkedIn REST API?

I am using the LinkedIn Marketing Development Platform where I am trying to provide a list of company URNs to to the Ad Analytics API. However, when I try to provide a list of company URNs, it fails with status 400.
Analytics Finder endpoint docs
My request:
GET https://api.linkedin.com/v2/adAnalyticsV2?q=analytics&pivot=CAMPAIGN&dateRange.start.day=1&dateRange.start.month=1&dateRange.start.year=2017&timeGranularity=ALL&companies=urn:li:organization:1234,urn:li:organization:5678
Response:
{"message":"Array parameter 'companies' value 'urn:li:organization:1234,urn:li:organization:5678' is invalid. Reason: Deserializing output 'urn:li:organization:1234,urn:li:organization:5678' failed","status":400}
I have also tried URL encoding the URL, and providing the list via the parameter companies[0] as is done in other examples in the docs.
What is the correct way to input arrays to the LinkedIn API?
Edit: Changed accounts to companies
So the Protocol Version actually gave me some useful insight. There are a couple of ways of providing arrays in parameters.
From the docs:
For Restli V1.0 (used by default)
GET GET https://api.linkedin.com/people?ids=1&ids=2&ids=3
For Restli V2.0, which you can use by setting the following header: X-RestLi-Protocol-Version: 2.0.0
Pass parameters in List format.
GET https://api.linkedin.com/v2/people?ids=List(1,2,3,4)
However, I have not managed to get the Analytics Finder API to work with Restli V2.0.
You'll need to provide the list of URL encoded organization URNs to the accounts param. Using your request as an example:
&accounts=List(urn%3Ali%3Aorganization%3A1234,urn%3Ali%3Aorganization%3A5678)

Autocomplete testing on Azure Search explorer

I am trying to build and test the auto complete feature on a master item lookup tables using Azure Search (for a ASP MVC application). The search index was done with the suggesterName SG set to ItemDisplayName
I was looking to test it first on Azure portal- so that I could aim to replicate the results via code. This is because the results I am getting in code are quite unexpected
As I type the substring the itemDislayName, the expectation was that upto 5 selected names will be displayed
On the portal, I tried a query string of
search=str&suggesterName=SG
with the base request URL containing the index, api version and sugestorName-but I don't get results of items containing 'str' and with the fuzziness as below
Could you please guide around
[1] how I can get suggestor output in azure portal-search explorer
[2] can I control fuzziness using queryType and ~1,~2
I was referring to these 3 links
1) https://learn.microsoft.com/en-us/rest/api/searchservice/suggestions
and
2) https://channel9.msdn.com/Shows/Azure-Friday/Azure-Search-103-Azure-Search-Suggestions-with-Liam-Cavanagh
3) gunnarpeipman.com/2016/07/azure-search-suggesters/
Azure Search Portal doesn't support the Suggestion API yet. You will need to use an HTTP client like Fiddler or Postman.
Make sure you use the right URL for you Suggest requests:
https://[service name].search.windows.net/indexes/[index name]/docs/suggest
Please use our User Voice page to vote for adding the Suggest API to the Portal: https://feedback.azure.com/forums/263029-azure-search

Get Post Insights for multiple posts in one call using Graph Api 2.7

I am trying to get post insights for a page feed using Facebook Graph API version 2.7 ..
If I only write:
'[Page ID]/feed?fields=insights'
It asks for metric, which indicates it should work... But when specifying a metric:
'[Page ID]/feed?fields=insights/post_impressions/lifetime'
I get syntax error.
I've tried with . notation as:
'[Page ID]/feed.insights/post_impressions/lifetime'
But stil no luck!
I know I can do it post by post (separate calls to API), but that is what I'm trying to avoid.
Anyone know what the correct syntax is for nested insights?
This bug report was able to shed some light: https://developers.facebook.com/bugs/1755454881375647/
You can use the metric keyword to specify the metrics you want, like so:
/page-id/posts?fields=insights.metric(post_impressions,post_consumptions_unique)
Name the metrics you are interested in there, and separate them with a comma.
Specifying the period (where applicable) seems to work by the same kind of syntax,
/…?fields=insights.metric(…).period(lifetime)
(Although it might not work to request different periods for different metrics in one go.)

OneNote on SharePoint REST API

The OneNote team recently published a blog post in which they explain how to access data from OneNote notebooks that are stored on SharePoint ('site-hosted notebooks', as they refer to them).
I'm trying to use the API as they describe it, but I'm unable to get it to work. Specifically, the first step is to find out my site collections and site ID using the following API call:
https://www.onenote.com/api/beta/myorganization/siteCollections/FromUrl(url='{full-path-to-SharePoint-site}')
It seems to fail no matter what I do: I tried to put the full path to my SharePoint site with and without 'http://' or 'https://', tried to write my organization name in various ways (with '-my' at the end, and without it), and probably a few other combinations as well - it just doesn't work. I keep getting error 400 / bad request.
Any help would be greatly appreciated.
So ... I had a fairly long correspondence with the guys from Microsoft, and here's what I learned:
If you're using a browser or a browser plug-in to test some of your REST APIs calls, it's not enough to be logged-in as the relevant user. This works for SharePoint and other Office 365 APIs, but not for this OneNote API. You must send "Authorization: Bearer ... " in the request headers.
Probably my stupid mistake, but 'myorganization' in the URL https://www.onenote.com/api/beta/myorganization/siteCollections/FromUrl(url='{full-path-to-SharePoint-site}') is not the name of your organization / domain: it's the literal string 'myorganization'.
Finally, the 'full-path-to-sharepoint-site' should point to https://xyz.sharepoint.com and not to https://xyz-my.sharepoint.com.
This syntax works like a charm for me:
https://www.onenote.com/api/beta/myorganization/siteCollections/FromUrl(url='https://XYZ.sharepoint.com/sites/ala')

Getting Logos from Sites with SiteInfo

We are attempting to get site logos from the Yodlee API. From the SiteInfo data model (using the SOAP API), there are the following methods that appear to retrieve site logos
siteInfo.getDefaultSiteLogo()
siteInfo.getLocalizedSiteLogos()
getDefaultFavIcon()
The issue is that these methods for the sites we are using (all sites with the AU geography) are returning null.
I am pretty sure this is possible to do, since Yodlee's own fastlink does show logos for sites as you are adding them.
Here are the method call signatures
I am using the soap api through java (using axis 1.4, just like in the sample code) and the API signatures are as follows
SiteAccountManagementService has the method getAllSiteAccounts which has the following signature
com.yodlee.soap.collections.core.accountmanagement.ArrayOfSiteAccountInfo getAllSiteAccounts(com.yodlee.soap.common.UserContext userContext).
Then there is also getCctx, which has the following signature
public com.yodlee.soap.common.CobrandContext getCctx()
None of these methods have a request specifier parameter of any sought
I don't think icons will be returned by default. I believe you need to specify this in your request specifier to get icons/image.
getAllSiteAccounts API is to get the details for the Accounts aggregated by a consumer,
while the information you are looking for(the Logos) are site related not consumer related.
You should use getSiteInfo(under SiteTraversal) to get this specific detail and remember to pass value of siteFilter.reqSpecifier as 128.