Search on global properties - box-api

Is it possible to do a search using the API on metadata in the properties template? I'm using the mdfilters parameter for the search request:
https://api.box.com/2.0/search?mdfilters=[{"templateKey":"properties", "scope":"global", "filters":{"docId": "1"}}]
The response I get is 404 Not Found:
{
"message": "Instance not found for '\\\"view\\\", \\\"typeKeyKey\\\", \\\"properties\\\", \\\"searchFilterPanel\\\"'",
"code": "tuple_not_found",
"request_id": "870411128557159b487c8a"
}
I suspect that the properties template cannot be used in a metadata search, is this correct?

No, not with mdfilters. Use a regular search instead. See this answer for more.

Related

Fetch Google Search results via Chrome extension

I am writing a chrome extension and I need to search a string in Google search engine and check if it appears among the first 10 results.
I have tried to use google search API but it didn't work, I used the following:
chrome.search.query({queryinfo:"search_string"});
And I get:
Error in event handler: TypeError: Cannot read properties of undefined (reading 'query')
any ideas?
you must use "text" and no "queryinfo"
chrome.search.query({text:"search_string"});
And you must used in manifest.json permission :
"permissions": [
"search"
]

Getting all application extensions, and just applicaiton extensions for an object from MS Graph

Assume I know the extension names I am looking for I could get a users extensions like so:
GET https://graph.microsoft.com/v1.0/users/{{OBJECT_ID}}?$select=extension_{{APP_ID_WITHOUT_GUIDS}}_SomeId,extension_{{APP_ID_WITHOUT_GUIDS}}_SomeValue
Or I could get the attributes from his member groups like so:
GET https://graph.microsoft.com/v1.0/users/{{OBJECT_ID}}/memberOf?$select=extension_{{APP_ID_WITHOUT_GUIDS}}_SomeId,extension_{{APP_ID_WITHOUT_GUIDS}}_SomeValue
However, what If I wanted to see all extension the token had paticular access to. $select=extension_* does not work I get the following:
{
"error": {
"code": "BadRequest",
"message": "Term 'extension_*' is not valid in a $select or $expand expression.",
"innerError": {
"request-id": "3b4e14d6-3bbc-429b-8c45-b0fea629f4a6",
"date": "2018-04-06T13:35:40"
}
}
}
Is there syntax to make this possible?
No, this isn't possible with Microsoft Graph (using v1 Directory Schema Extensions). With Azure AD Graph API there is a function - getAvailableExtensionProperties - that should return all the available v1 directory schema extensions available in the tenant; this doesn't exist in Microsoft Graph. If you use Microsoft Graph schema extensions, you can query /schemaExtensions to find all public schema extension definitions available for use in any tenant (although your app also needs to have been granted access to the underlying extended object - like user).
Hope this helps,

How do I access the inner data in this Google Custom Search errors array?

I have a web app using Google Custom Search via REST. So far, everything works fine, but when I exceed the allotted daily quota of queries, I want to give the user some info about it. I get this JSON response, and I can access the "code" and "message" data using response.error.code and response.error.message, but I don´t know how to access the subset "errors", specifically "reason".
I know this is a JSON question, but I don´t have much experience with it.
This is the JSON structure I receive (which is what I expect)
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "dailyLimitExceeded",
"message": "This API requires billing to be enabled on the project. Visit https://console.developers.google.com/billing?project=323544036192 to enable billing.",
"extendedHelp": "https://console.developers.google.com/billing?project=323544036192"
}
],
"code": 403,
"message": "This API requires billing to be enabled on the project. Visit https://console.developers.google.com/billing?project=323544036192 to enable billing."
}
}
I found the solution trying different things. I think I got lucky.
console.log(response.error.errors[0].reason);
This gives me the data I was trying to access.

How to get specific items in Microsoft Graph´s JSON response

Hello I am using Microsoft Graph with OneNote and when I make the following request : https://graph.microsoft.com/v1.0/me/onenote/pages?$select=title,links
I get this response:
I don´t need the "oneNoteClientUrl" attribute, so How can I get only the "oneNoteWebUrl" attribute.
And when I use: pages? search=item&select=title,links.
I get this issue.
{
"error": {
"code": "10002",
"message": "The service is currently unavailable. Please try again later.",
"innerError": {
"request-id": "13535682-a12b-4127-935b-6601154c1416",
"date": "2017-05-31T21:38:04"
}
}
}
I read that "search is available for consumer notebooks only"
How can I get pages with specific words in their content and title?
Unfortunately, the API doesn't yet support searching pages in SharePoint - only in OneDrive consumer. This is something in our radar, but we don't yet have any ETA on this.
I encourage you to create/upvote a uservoice entry for this.
https://onenote.uservoice.com/forums/245490-onenote-developer-apis

Having trouble PUTting profile variables in Watson Dialog service

I think this is actually two (related) problems. If I try to set profile variables in the Watson Dialog API via Postman, I don't get any errors (200 return code) but the variables don't get set. This is the data I'm sending:
{
"client_id": 152008,
"name_values":[
{
"name": "second",
"value": "2"
}]
}
and this is the answer I get:
{
"client_id": 152008,
"name_values": []
}
Doing a GET confirms that the variables were not set.
If I try to do it via dialog.updateProfile() in the watson-developer-cloud package using the same JSON, I get
Error: Missing required parameters: name_values
instead.
Has anyone successfully set Watson Dialog profile variables? How did you do it?
The Dialog profile variable you wish to manipulate via the API needs to already exist in the Dialog XML file. You can not create a new Dialog profile variable via the API.