Ronald Wildenberg
Ronald Wildenberg

Reputation: 32094

Error when creating Azure AD application on Graph API beta endpoint

I'm posting the following payload to the https://graph.microsoft.com/beta/applications endpoint:

{
  "displayName": "23e724af-2544-4764-ab56-520710fda746",
  "homepage": "https://23e724af-2544-4764-ab56-520710fda746",
  "identifierUris": [ "urn:23e724af-2544-4764-ab56-520710fda746" ],
  "replyUrls": [ "https://23e724af-2544-4764-ab56-520710fda746" ],
  "requiredResourceAccess": [],
  "signInAudience": "AzureADMyOrg"
}

This fails with an HTTP 400 response with the following response body:

{
  "error": {
    "code": "Request_BadRequest",
    "message": "A value without a type name was found and no expected \
                type is available. When the model is specified, each value \
                in the payload must have a type which can be either specified \
                in the payload, explicitly by the caller or implicitly \
                inferred from the parent value.",
    "innerError": {
      "request-id": "3de11d38-b10a-4711-baa5-0daee8af1b22",
      "date": "2019-03-04T07:20:37"
    }
  }
}

Anyone have a clue what I'm doing wrong?

The service principal I'm making this call with has the Application.ReadWrite.OwnedBy permission.

Upvotes: 0

Views: 312

Answers (1)

Joy Wang
Joy Wang

Reputation: 42043

I can reproduce your issue on my side, in the request body, you need to supply a JSON representation of application object. See : Request body. The homepage and replyUrls are not its properties, remove them, then it will work.

enter image description here

Upvotes: 1

Related Questions