All samples

Microsoft Graph mocks from Microsoft Graph API docs with sandbox data

This sample contains mocks for the Microsoft Graph API based on the Microsoft Graph API documentation. Mocks are created based on sample requests and responses included in the Microsoft Graph documentation. Mocks are extended with the data from sandbox, which is used by Microsoft Graph Explorer and other Microsoft's properties. Using these mocks, you can simulate calling Microsoft Graph API without having to connect to the actual service. This is useful for testing and development purposes. These mocks are also helpful when you want to demo time-sensitive functionality such as recently opened files, without having to generate activity on your tenant for Microsoft Graph to return the data. The sample contains three mock files: mocks for Microsoft Graph v1.0 endpoints (graph-v1_0-proxy-mocks.json), mocks for Microsoft Graph beta endpoints (graph-beta-proxy-mocks.json) and mocks combining both v1.0 and beta endpoints (graph-proxy-mocks.json).

Waldek Mastykarz

Microsoft Graph mocks from Microsoft Graph API docs with sandbox data

Summary

This sample contains mocks for the Microsoft Graph API based on the Microsoft Graph API documentation. Mocks are created based on sample requests and responses included in the Microsoft Graph documentation. Mocks are extended with the data from sandbox, which is used by Microsoft Graph Explorer and other Microsoft’s properties.

Using these mocks, you can simulate calling Microsoft Graph API without having to connect to the actual service. This is useful for testing and development purposes. These mocks are also helpful when you want to demo time-sensitive functionality such as recently opened files, without having to generate activity on your tenant for Microsoft Graph to return the data.

Dev Proxy simulating mocking Microsoft Graph API request to /users

Compatibility

Dev Proxy v2.1.0

Contributors

Version history

VersionDateComments
1.10February 4, 2026Updated to Dev Proxy v2.1.0
1.9January 18, 2026Moved config files to .devproxy folder
1.8January 5, 2026Updated to Dev Proxy v2.0.0
1.7June 27, 2025Updated to Dev Proxy v0.29.2
1.6.1April 9, 2025Fixed bugs
1.6February 19, 2025Updated mocks, added preset
1.5January 25, 2024Updated schema version
1.4January 11, 2024Updated to new format
1.3December 22, 2023Updated to new format
1.2November 17, 2023Updated mocks
1.1November 14, 2023Renamed to Dev Proxy
1.0September 22, 2023Initial release

Minimal path to awesome

  • Get the sample:
    • Download just this sample:

      npx gitload-cli https://github.com/pnp/proxy-samples/tree/main/samples/microsoft-graph-sandbox-mocks

      or

    • Download as a .ZIP file and unzip it, or

    • Clone this repository

  • Start Dev Proxy specifying the path to one of the mock files, eg. devproxy --mocks-file graph-proxy-mocks-sandbox.json

Features

The sample contains three mock files:

  • mocks for Microsoft Graph v1.0 endpoints (graph-v1_0-proxy-mocks-sandbox.json)
  • mocks for Microsoft Graph beta endpoints (graph-beta-proxy-mocks-sandbox.json)
  • mocks combining both v1.0 and beta endpoints (graph-proxy-mocks-sandbox.json)

If you only use v1.0 or beta Microsoft Graph endpoints, you can load the specific mocks file for better performance. If you want to mock requests to both v1.0 and beta endpoints, you can use the combined file instead.

Help

We do not support samples, but this community is always willing to help, and we want to improve these samples. We use GitHub to track issues, which makes it easy for community members to volunteer their time and help resolve issues.

You can try looking at issues related to this sample to see if anybody else is having the same issues.

If you encounter any issues using this sample, create a new issue.

Finally, if you have an idea for improvement, make a suggestion.

Disclaimer

THIS CODE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.