post: forward
9/18/2020
2 minutes to read
In this article
Namespace: microsoft.graph
Forward a post to a recipient. You can specify both the parent conversation and thread in the request,
or, you can specify just the parent thread without the parent conversation.
Permissions
One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions .
Permission type
Permissions (from least to most privileged)
Delegated (work or school account)
Group.ReadWrite.All
Delegated (personal Microsoft account)
Not supported.
Application
Group.ReadWrite.All
HTTP request
POST /groups/{id}/threads/{id}/posts/{id}/forward
POST /groups/{id}/conversations/{id}/threads/{id}/posts/{id}/forward
Header
Value
Authorization
Bearer {token}. Required.
Request body
In the request body, provide a JSON object with the following parameters.
Parameter
Type
Description
comment
String
Optional comment that is forwarded together with the post.
toRecipients
recipient collection
The recipients to whom the threaded is forwarded to.
Response
If successful, this method returns 200 OK
response code. It does not return anything in the response body.
Example
Here is an example of how to call this API.
Request
Here is an example of the request.
POST https://graph.microsoft.com/v1.0/groups/{id}/threads/{id}/posts/{id}/forward
Content-type: application/json
Content-length: 166
{
"comment": "comment-value",
"toRecipients": [
{
"emailAddress": {
"name": "name-value",
"address": "address-value"
}
}
]
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var comment = "comment-value";
var toRecipients = new List<Recipient>()
{
new Recipient
{
EmailAddress = new EmailAddress
{
Name = "name-value",
Address = "address-value"
}
}
};
await graphClient.Groups["{id}"].Threads["{id}"].Posts["{id}"]
.Forward(toRecipients,comment)
.Request()
.PostAsync();
Read the SDK documentation for details on how to add the SDK to your project and create an authProvider instance.
const options = {
authProvider,
};
const client = Client.init(options);
const forward = {
comment: "comment-value",
toRecipients: [
{
emailAddress: {
name: "name-value",
address: "address-value"
}
}
]
};
let res = await client.api('/groups/{id}/threads/{id}/posts/{id}/forward')
.post(forward);
Read the SDK documentation for details on how to add the SDK to your project and create an authProvider instance.
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/v1.0/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/groups/{id}/threads/{id}/posts/{id}/forward"]]];
[urlRequest setHTTPMethod:@"POST"];
[urlRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
NSMutableDictionary *payloadDictionary = [[NSMutableDictionary alloc] init];
NSString *comment = @"comment-value";
payloadDictionary[@"comment"] = comment;
NSMutableArray *toRecipientsList = [[NSMutableArray alloc] init];
MSGraphRecipient *toRecipients = [[MSGraphRecipient alloc] init];
MSGraphEmailAddress *emailAddress = [[MSGraphEmailAddress alloc] init];
[emailAddress setName:@"name-value"];
[emailAddress setAddress:@"address-value"];
[toRecipients setEmailAddress:emailAddress];
[toRecipientsList addObject: toRecipients];
payloadDictionary[@"toRecipients"] = toRecipientsList;
NSData *data = [NSJSONSerialization dataWithJSONObject:payloadDictionary options:kNilOptions error:&error];
[urlRequest setHTTPBody:data];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
//Request Completed
}];
[meDataTask execute];
Read the SDK documentation for details on how to add the SDK to your project and create an authProvider instance.
IGraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
String comment = "comment-value";
LinkedList<Recipient> toRecipientsList = new LinkedList<Recipient>();
Recipient toRecipients = new Recipient();
EmailAddress emailAddress = new EmailAddress();
emailAddress.name = "name-value";
emailAddress.address = "address-value";
toRecipients.emailAddress = emailAddress;
toRecipientsList.add(toRecipients);
graphClient.groups("{id}").threads("{id}").posts("{id}")
.forward(comment,toRecipientsList)
.buildRequest()
.post();
Read the SDK documentation for details on how to add the SDK to your project and create an authProvider instance.
Response
Here is an example of the response.
HTTP/1.1 200 OK