< Back

Invoke-MgaRestMethodPost

Sat Jan 18, 2020 4:41 pm

NAME Invoke-MgaRestMethodPost



SYNOPSIS

Performs a REST POST against the graph API





SYNTAX

Invoke-MgaRestMethodPost [-Field] <String> [[-User] <String>] [[-Body] <String>] [[-ContentType] <String>]

[[-ApiConnection] <String>] [[-ApiVersion] <String>] [[-Token] <AzureAccessToken>] [[-FunctionName] <String>]

[<CommonParameters>]





DESCRIPTION

Performs a REST POST against the graph API.

Primarily used for internal commands.





PARAMETERS

-Field <String>

The api child item under the username in the url of the api call.

If this didn't make sense to you, you probably shouldn't be using this command ;)



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-User <String>

The user to execute this under. Defaults to the user the token belongs to.



Required? false

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Body <String>

JSON date as string to send as body on the REST call



Required? false

Position? 3

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ContentType <String>

Nature of the data in the body of an entity. Required.



Required? false

Position? 4

Default value application/json

Accept pipeline input? false

Accept wildcard characters? false



-ApiConnection <String>

The URI for the Microsoft Graph connection



Required? false

Position? 5

Default value (Get-PSFConfigValue -FullName 'MSGraph.Tenant.ApiConnection' -Fallback

'https://graph.microsoft.com')

Accept pipeline input? false

Accept wildcard characters? false



-ApiVersion <String>

The version used for queries in Microsoft Graph connection



Required? false

Position? 6

Default value (Get-PSFConfigValue -FullName 'MSGraph.Tenant.ApiVersion' -Fallback 'v1.0')

Accept pipeline input? false

Accept wildcard characters? false



-Token <AzureAccessToken>

The access token to use to connect.



Required? false

Position? 7

Default value

Accept pipeline input? false

Accept wildcard characters? false



-FunctionName <String>

Name of the higher function which is calling this function.



Required? false

Position? 8

Default value $MyInvocation.MyCommand

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Invoke-MgaRestMethodPost -Field "messages/$($id)/reply" -Body '{"comment": "comment-value"}' -Token $Token



Reply to the sender of a message with the id, stored in variable $id. The message is then saved in the Sent Items

folder.

The token stored in $Token is used for the api call.











RELATED LINKS