Unable to update threat intelligence indicator beta endpoint - microsoft-graph-api

I have created and pushed indicator to Microsoft Azure Sentinel. I have checked that I can access it using GET request with
https://graph.microsoft.com/beta/security/tiIndicators/{id}
However when I am trying to update the indicator using PATCH request and the same link, then I am getting this error:
"code": "NotFound",
"message": "The requested resource was not found."
I also tried to update this one indicator by posting id and new attribute to :
https://graph.microsoft.com/beta/security/tiIndicators/updateTiIndicators
but then I am getting this error:
"code": "",
"message": "Object reference not set to an instance of an object."
Can not figure out why I am getting such error and how can I update the indicator.

PATCH threat intelligence indicators requires 'targetProduct' and 'expirationDateTime'. Please make sure to specify targetProduct (in this case 'Azure Sentinel' and expirationDateTime in your json that you're trying to update.

Related

Getting a list of all Media in Instagram with Graph API

In my code, I have been pulling the list of media in Instagram using the following URL:
https://graph.facebook.com/{app_id}/media?fields=media_url,{..some fields here...}&limit=10000&access_token={my_access_token}
This was working fine and I didn't touch the code for a month. Now suddenly it gives the error:
{
"error": {
"message": "(#100) Tried accessing nonexisting field (media) on node type (Application)",
"type": "OAuthException",
"code": 100,
"fbtrace_id": "Aty4vnPpLWfGq9Hj6hQFtZR"
}
}
Nothing in the documentation says that media is no longer available. Graph API version has updated from v14 to v15 since I used it, but the request isn't working on either version.
Access token is fine because other requests are working correctly.
Does anyone have any insights? What alternatives do I have?
I think you are defining an invalid field. Below is a list of fields you can use. Also i suggest you also try instagram account id instead of app_id.
fields=[id,ig_id,media_product_type,media_type,media_url,thumbnail_url,timestamp,
username,like_count,comments_count]
final url:
https://graph.facebook.com/v14.0/{instagram_account_id}/media?fields=id,ig_id,media_product_type,media_type,media_url,thumbnail_url,timestamp,
username,like_count,comments_count&access_token={my_access_token}

A post call to add a new openTypeExtension to event data fails with “Resource not found for the segment 'extensions'”

I am trying to add an extension to the event resource using Graph Explorer. I am using POST on https://graph.microsoft.com/v1.0/event/extensions with request body
{
"#odata.type": "microsoft.graph.openTypeExtension",
"extensionName": "com.wrike.WrikeIDs",
"id": "",
"permalink": ""
}
I get the error
"Resource not found for the segment 'event'"
and sometimes I get
"The OData request is not supported"
Content type is application/json
The error message might be misleading.
Try to adjust the path to
POST https://graph.microsoft.com/v1.0/me/events/{event_id}/extensions

Unable to update organization properties

I've encountered a problem while trying to update organization's properties using Microsoft Graph API. I've followed these docs and tried it in graph explorer.
My request looks like this:
{ "displayName": "My Company Name" }
Whatever I do I always get the following error:
"error": {
"code": "Request_BadRequest",
"message": "Specified HTTP method is not allowed for the request target.",
"innerError": {
"request-id": "dfd9ae19-2774-4b10-8d74-f6f6cd21f712",
"date": "2016-05-16T14:48:02"
}
}
What am I doing wrong?
I have tried in my test tenant and results in the same error.
https://graph.microsoft.io/en-us/docs/api-reference/v1.0/resources/organization
In the above document it is mentioned that we can update "marketingNotificationMails" and "technicalNotificationMails" properties alone through Update API. So I think you can't update the organization display name.
It does appear as though updates are limited on the organization entity. Please file a request to Uservoice to ask for this feature.

GraphApi API error codes

I am attempting to create a interface between our web application and the GraphApi.
I am currently struggling to handle error correctly as the documentation for graph API seems to be at best incomplete. Is there a reference to full list of errors one should expect.
An example of the issue is where I make a request after my access token has expired. The error code is not on the list (graph.microsoft.io docs/overview/errors page) and in a different format (capitalization). It also seems to vary drastically from the azure error codes such as "Request_BadRequest". This was found in an MSDN article titled "Error codes and error handling | Graph API concepts".
The document states "You may use the information returned here instead of, or in addition to the HTTP status code returned.". However, this is really hard if they are changing despite being out of beta.
example of an error response body:
{ "error": {
"code": "InvalidAuthenticationToken",
"message": "Access token has expired.",
"innerError": {
"request-id": "267438d2-4cc5-4621-9307-2af26d2f5b49",
"date": "2016-02-16T13:30:24"
}
}
}

Google Custom Search: 403 error in iOS

Google Custom Search is returning this 403 error from my iPhone 7.1 app. This is the response when run in the simulator:
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "accessNotConfigured",
"message": "Access Not Configured. Please use Google Developers Console to activate the API for your project."
}
],
"code": 403,
"message": "Access Not Configured. Please use Google Developers Console to activate the API for your project."
}
}
Is there a flaw in the steps below? I’d like to establish a working CSE setup process specific to iOS apps. The screenshots at each step will hopefully help and not confuse!
Create a Custom Search Engine (CSE) at https://www.google.com/cse/
From Setup -> Basics, get the Search engine ID.
Test the CSE at https://developers.google.com/apis-explorer/#p/customsearch/v1/search.cse.list
Set "q" to any test query terms ("foo bar") and "cx" to the Search engine ID in step 2.
Press "Execute" and receive your search results. They work. Google also provides this URL which we'll re-use in Xcode in step 8.
To get ourselves a key for ID and billing purposes, create a new project at https://console.developers.google.com/
Under APIs & auth -> APIs -> Enable "Custom Search API." No other APIs are enabled.
Under APIs & auth -> Credentials -> Create a new iOS key.
Note: I also tried a browser key and the search result returned "Error 400: Invalid Value." I returned to the iOS key since I'm on iOS and the error seemed less severe.
Add to this key your bundle identifier from Xcode.
In Xcode make your GET request to the URL in step 3. Replace {YOUR_API_KEY} with the key from your credentials in steps 6-7.
NSData *response contains the error 403 shown above. Thanks for any thoughts on what's wrong!
It was missing the header field X-Ios-Bundle-Identifier.
NSString *bundleID = #"com.yourCompany.yourApp";
//...define request as above
[request setHTTPMethod:#"GET"];
[request setValue:bundleID forHTTPHeaderField:#"X-Ios-Bundle-Identifier"];

Resources