302 Found response when attempting to create subscription.

Michael Barry 0 Reputation points
2024-06-26T14:57:39.9233333+00:00

Hi, I'm encountering an error when trying to create a subscription with the Microsoft Graph API.

I first request an access token using login.microsoftonline.com and I get an access token back successfully. I think make a request to graph.microsoft.com/v1.0/subscriptions. The request looks like this:

POST /v1.0/subscriptions HTTP/1.1
User-Agent: PATH Script Processor
Accept: */*
content-length:    238
Host: graph.microsoft.com
Content-Type: application/json
Authorization: Bearer ****
{"changeType":"created,updated,deleted","notificationUrl":"https://transa
ctzar.com:500","expirationDateTime":"2024-06-26T16:35:30.000000Z","lifecycleNoti
ficationUrl":"https://transactzar.com:500","resource":"chats/getAllMessages?mode
l=B"}
The response that comes back looks like this:
HTTP/1.1 302 Found
Content-Length: 0
Location: https://login.microsoftonline.com:443/v1.0/subscriptions
client-request-id: e5da8ccb-ea1f-4437-a4f2-3bcef1600ca6
Date: Wed, 26 Jun 2024 14:35:30 GMT

However, I don't understand why this is the response I get.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,800 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.