Skip to content
This repository was archived by the owner on Sep 4, 2020. It is now read-only.

Commit 7cee29d

Browse files
author
Caitlin Bales (MSFT)
authored
Create custom-queries.md
1 parent 6b6b319 commit 7cee29d

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

docs/custom-queries.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Making Custom Calls to Graph
2+
3+
The Graph SDK attempts to enable all available scenarios through Microsoft Graph. There are times, however, through errors or custom Graph functionality, that makes calling the desired endpoint is not possible through the provided requests and builders.
4+
5+
## Creating a custom request
6+
You can extend BaseRequest to create a custom request:
7+
8+
```Java
9+
public class CustomRequest extends BaseRequest {
10+
11+
public CustomRequest(final String requestUrl, final IBaseClient client, final java.util.List<Option> requestOptions) {
12+
super(requestUrl, client, requestOptions, Void.class);
13+
}
14+
15+
public String get() throws ClientException {
16+
return send(HttpMethod.GET, null);
17+
}
18+
}
19+
```
20+
Then you can instantiate a new request to use to call Graph:
21+
22+
```Java
23+
CustomRequest request = new CustomRequest("https://graph.microsoft.com/v1.0/custom", graphServiceClient, requestOptions);
24+
request.get();
25+
```

0 commit comments

Comments
 (0)