Skip to content

Sample call to create a new Subscription does not work without __metadata.type #7329

@ejschoen

Description

@ejschoen

Creating a new subscription by posting to the /subscriptions endpoint under a list appears to require the body of the request contain "__metadata": {"type":"Microsoft.SharePoint.Webhooks.Subscription"} in addition to values for resource, notificationUrl, and expirationDateTime. Otherwise, SharePoint returns:

"{"error":{"code":"-1, Microsoft.SharePoint.Client.InvalidClientQueryException","message":{"lang":"en-US","value":"
An entry without a type name was found, but no expected type was specified.
To allow entries without type information, the expected type must also be specified when the model is specified."}}}"


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:csom/rest/apiCategory: SharePoint Client Side Object Model SDK / REST APIarea:docs-commentCategory: Comment left on bottom of a docs page here: https://docs.microsoft.com/sharepoint/devtype:archive-old-issueIssues which are closed as tool old for active work

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions