mirror of
https://github.com/MicrosoftDocs/windows-itpro-docs.git
synced 2025-06-20 04:43:37 +00:00
API pages update
1. Adding US Gov reference to all pages with URIs. 2. Adding geo reference to all pages with URIs. 3. Replace MDE URLs ending with "windows.com" with "microsoft.com". 4. Replace the login endpoint from "login.windows.net" to "login.microsoftonline.com".
This commit is contained in:
@ -26,6 +26,8 @@ ms.topic: article
|
||||
|
||||
- [Microsoft Defender for Endpoint](https://go.microsoft.com/fwlink/p/?linkid=2146631)
|
||||
|
||||
[!include[Microsoft Defender for Endpoint API URIs for US Government](../../includes/microsoft-defender-api-usgov.md)]
|
||||
|
||||
Run advanced queries using Python, see [Advanced Hunting API](run-advanced-query-api.md).
|
||||
|
||||
In this section, we share Python samples to retrieve a token and use it to run a query.
|
||||
@ -36,6 +38,8 @@ In this section, we share Python samples to retrieve a token and use it to run a
|
||||
|
||||
- Run the following commands:
|
||||
|
||||
[!include[Improve request performance](../../includes/improve-request-performance.md)]
|
||||
|
||||
```
|
||||
|
||||
import json
|
||||
@ -46,9 +50,9 @@ tenantId = '00000000-0000-0000-0000-000000000000' # Paste your own tenant ID her
|
||||
appId = '11111111-1111-1111-1111-111111111111' # Paste your own app ID here
|
||||
appSecret = '22222222-2222-2222-2222-222222222222' # Paste your own app secret here
|
||||
|
||||
url = "https://login.windows.net/%s/oauth2/token" % (tenantId)
|
||||
url = "https://login.microsoftonline.com/%s/oauth2/token" % (tenantId)
|
||||
|
||||
resourceAppIdUri = 'https://api.securitycenter.windows.com'
|
||||
resourceAppIdUri = 'https://api.securitycenter.microsoft.com'
|
||||
|
||||
body = {
|
||||
'resource' : resourceAppIdUri,
|
||||
@ -78,7 +82,7 @@ where
|
||||
```
|
||||
query = 'RegistryEvents | limit 10' # Paste your own query here
|
||||
|
||||
url = "https://api.securitycenter.windows.com/api/advancedqueries/run"
|
||||
url = "https://api.securitycenter.microsoft.com/api/advancedqueries/run"
|
||||
headers = {
|
||||
'Content-Type' : 'application/json',
|
||||
'Accept' : 'application/json',
|
||||
|
Reference in New Issue
Block a user