< Back

New-GraphSubscription

Sat Jan 18, 2020 4:10 pm

NAME New-GraphSubscription



SYNOPSIS

Creates a new subscription object in the Microsoft Graph API





SYNTAX

New-GraphSubscription [-Token] <AuthenticationResult> [-ResourceUri] <String> [-WebhookUri] <String>

[[-ChangeType] <String[]>] [[-ExpiratetionDateTime] <DateTime>] [[-ClientState] <String>] [<CommonParameters>]





DESCRIPTION

Creates a new subscription object in the Microsoft Graph API





PARAMETERS

-Token <AuthenticationResult>



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ResourceUri <String>



Required? true

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-WebhookUri <String>



Required? true

Position? 3

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ChangeType <String[]>



Required? false

Position? 4

Default value Created

Accept pipeline input? false

Accept wildcard characters? false



-ExpiratetionDateTime <DateTime>



Required? false

Position? 5

Default value (get-date).ToUniversalTime().AddMinutes(4230)

Accept pipeline input? false

Accept wildcard characters? false



-ClientState <String>



Required? false

Position? 6

Default value DefaultClientState

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



NOTES





This is a preview/beta version. Please send any comments to jgs@coretech.dk

Developed by MVP Jakob Gottlieb Svendsen - jakob@runbook.guru - jgs@coretech.dk



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



PS C:\\>$Token = Get-GraphAuthToken -AADTenant "runbookguru.onmicrosoft.com" -ClientId

"cdec3c46-b1cd-4ce7-859a-b6fac1ceafee" -RedirectUri "http://www.runbook.guru" -Credential (get-credential)



$webhook = "https://demo.azurewebsites.net/api/webh ... =VYa2bgSAP

Ct9NoIx8%2f%2fmG2HrVMvp46vta5Zq6%2bo468Q%3d"

$resource = "me/mailFolders('Inbox')/messages"

New-GraphSubscription -Token $Token -ResourceUri $resource -WebhookUri $webhook -ChangeType Created,Deleted,Updated











RELATED LINKS

http://graph.microsoft.io/

http://graph.microsoft.io/en-us/docs/ap ... scription/

http://graph.microsoft.io/en-us/docs/ap ... criptions/