Content used by the DevX API to enhance clients and tooling. At the moment it has:
This will also be used by the localization team to add translation files, and by feature teams to modify, add, or update samples.
To add sample queries follow these steps:
If you have write access to this repo (microsoft-graph-devx-content), clone the repo to your local machine. You can do so using this command:
git clone https://github.com/microsoftgraph/microsoft-graph-devx-content.git microsoft-graph-devx-content
cd microsoft-graph-devx-content/sample-queries
If you don't have write access or you are a new contributor, fork your copy of the repo by clicking on the Fork button at the top right of this page.
{ "id": "76ecc500-897d-4a5e-a15c-0f6702a43d32", "category": "Extensions", "method": "GET", "humanName": "get available schema extensions", "requestUrl": "/v1.0/schemaExtensions", "docLink": "https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/schemaextension_post_schemaextensions", "skipTest": false },
POST Example includes headers, post body and a tip
{
"id": "9b937d40-885d-4eb1-a36d-9b001ce63d1d",
"category": "OneNote",
"method": "POST",
"humanName": "create section",
"requestUrl": "/v1.0/me/onenote/notebooks/{notebook-id}/sections",
"docLink": "https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/notebook_post_sections",
"headers": [
{
"name": "Content-type",
"value": "application/json"
}
],
"postBody": "{\r\n \"displayName\": \"Section 1\"\r\n}",
"tip": "This query requires a notebook id. To find the ID, you can run: GET https://graph.microsoft.com/v1.0/me/onenote/notebooks. ",
"skipTest": false<br>
},
- headers - add the headers required to run the POST query
- postBody - add the post body required to run the query
- tip - include a tip giving more information to the user on things like permissions required, and how to get an id if needed.
When done making the changes on the document,
Once the PR is reviewed and merged, the changes will appear on Graph Explorer in 2 working days.
"id":
"category":
"method":
"humanName":
"requestUrl":
"docLink":
"headers":
"postBody":
"tip":
"skipTest":
humanName
value should be in small caps only.requestUrl
value should be a relative url, starting from the version, i.e. "requestUrl": "/v1.0/me/onenote/notebooks/{notebook-id}/sections"
leave out the https://graph.microsoft.com
part of the url.
To open the sample-queries.json file, paste in this command:
code -n sample-queries.json
Alternatively, you can open the directory where the file is located by pasting in this command:
start .
If your machine's OS/CPU is x64, paste in this command:
start "%PROGRAMFILES%\Git\bin\sh.exe" --login
else, if x86, paste in this command:
start "%SYSTEMDRIVE%\Program Files (x86)\Git\bin\sh.exe"
Your branch name has to be of the format: {your-intial}/{purpose-of-change}.
Replace the text within the curly braces (inclusive of the curly braces).
Then in the new Git command line window, paste in this command to create and checkout your branch:
git checkout -b {your-branch-name}
Now you can add, update or delete your sample query in the sample-queries.json
file that opened up in VS Code earlier.
git add sample-queries.json
git commit -m "{add-reason-for-update}"
git push origin {your-branch-name}
Follow the instructions to login to GitHub using your credentials.
Follow the instructions specified, then run this command again:
git push origin {your-branch-name}
Once you've added/updated the sample queries, you can test them out by going to Graph Explorer, and appending this to the end of the Graph Explorer url.
?devx-api=https://graphexplorerapi.azurewebsites.net&org={org}&branchName={branchName}
This fetches the permissions/samples from your specific branch or repo.
https://developer.microsoft.com/en-us/graph/graph-explorer?devx-api=https://graphexplorerapi.azurewebsites.net&org={org}&branchName={branchName}
i. Replace {branchName} with the name of your current branch.
ii. In the case of a forked repo, replace the {org} parameter with your Github username. iii. If your branch is in this repo, replace {org} with microsoftgraph
https://developer.microsoft.com/en-us/graph/graph-explorer?devx-api=https://graphexplorerapi.azurewebsites.net&org=MeganBowen&branchName=mk/update-sample
The samples/permissions will be populated on Graph Explorer and you can do further testing.
Contributions to permissions are limited to contributors with write access. However, issues on missing permissions can be raised as issue requests on the issues tab.
In case you see You are viewing a cached set of samples because of a network connection failure, check the query parameters and confirm they're correct, then reload the page.
If you run into any issues, reach out to @MaggieKimani1, @irvinesunday or @thewahome.