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

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

Related

android-publisher verification testing

Hi I am currently working on an app with an in-app-shop. Now I need to implemented Server Side Verification for Google In-app-purchases. We use https://github.com/googleapis/google-api-php-client for the verification. We already got the in app purchases and have tested the in app purchases with the test products (android.test.purchased). Is there a way to test the validation ? In the moment i get the following response when using a "android.test.purchased" for the following call
$googleApiResult = $service->purchases_products->get($_ENV['PACKAGENAME'], $productId, $token);
{
"error": {
"code": 400,
"message": "Invalid Value",
"errors": [
{
"message": "Invalid Value",
"domain": "global",
"reason": "invalid"
}
]
}
}
In the docs it states that you need the productive data. The app has already an Alpha Track. On the alpha track in the Google Store the in app purchases are also approved but cannot get verified by the backend. Since the alpha track is a productive enviroment, we do not have the console or network logs to check whats the problem. What is the best practice here. Is there a way to debug verification ?
In my case the problem is insufficent permission of my Google Client. I used the tokens which we got from the productive enviroment and used them in the local api.

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.

Search on global properties

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.

How can I like a Fanpage with the Facebook Graph API

it is possible to lika a FanPage with the actionscript3 Facebook Api or the Graph API?
I used follow methode:
Facebook.api(Page_ID + "/likes/", getLikeHandler, URLRequestMethod.POST);
But I get follow Exception
{
"error": {
"message": "(#3) Application does not have the capability to make this API call.",
"type": "OAuthException",
"code": 3
}
}
Do you have an solution for my problem?
This is currently not possible via any of the public Facebook APIs. You can only publish 'likes' for Open Graph objects.