REST API Get with Json body RRS feed

  • Question

  • I am trying to do a request with a Json body but I am getting an error "Cannot send a content-body with this verb-type".

    It's a rest call to the Graph API, just doing some testing now. Trying to get a list of Planner buckets and tested the request here first :

    Script I am using:

    $task = @"
      "planId": "DxNKjHcrkE-gZyw7gL-******",
      "bucketId": "hsOf2dhOJkqyYY*****",
      "title": "Update client list",
      "assignments": {
        "fbab97d0-4932-4511-*****-****": {
          "@odata.type": "#microsoft.graph.plannerAssignment",
          "orderHint": " !"
    $url = '<id>/buckets'
    Invoke-RestMethod -Headers @{Authorization = "Bearer $accesstoken"} -Uri $url -Body $task -Method GET -ContentType 'application/json'

    • Moved by Bill_Stewart Friday, July 7, 2017 4:35 PM Off-topic
    Friday, May 5, 2017 2:24 PM

All replies