Forum Discussion

webmasterSANTEE's avatar
webmasterSANTEE
Copper Contributor
Sep 01, 2022

Struggling with my BODY [my BODY is ok! - TY Lain]

 

 

        $URL = $betaGraphURL+"/users/"+$DATA[5]+"/onlineMeetings"
        $OLMeetingBODY = @{
            "startDateTime" = $finalCLASSstart
            "endDateTime" = $finalCLASSend
            "subject" = $classTITLE
            "broadcastSettings" = @{
                "allowedAudience" = "everyone"
                "isQuestionAndAnswerEnabled" = $true
            }
        }
        $OLMeeting = invoke-restmethod -head $d_HEAD -uri $URL -method post -body ($OLMeetingBODY|convertto-json)

 

 

 

Hello community!

 

Line 6 is giving me grief.  It works without any 'broadcastSettings' enabled.  I know it has to be something quick an simple.  But for the life of me, I just cannot seem to get it to work.

 

$DATA[5] = Users Object ID

$d_HEAD = Delegation header

 

Any guidance would be ever so appreciated!

~WM

  • webmasterSANTEE 

     

    This is more a Graph question than a PowerShell question since there's nothing wrong with your example from the PowerShell perspective.

     

    I tested your example (using my own variable values since we can't see yours) and it parsed just fine:

     

     

    Looking at the second example in the reference documentation, I can't help but wonder if the fact you're missing the "isBroadcast = $true" isn't causing an issue. Perhaps you need this directive to go along with the settings you have in broadcastSettings - dunno, I'm just guessing as this is squarely in the Graph domain (not PowerShell.)

     

     

    Cheers,

    Lain

  • LainRobertson's avatar
    LainRobertson
    Silver Contributor

    webmasterSANTEE 

     

    This is more a Graph question than a PowerShell question since there's nothing wrong with your example from the PowerShell perspective.

     

    I tested your example (using my own variable values since we can't see yours) and it parsed just fine:

     

     

    Looking at the second example in the reference documentation, I can't help but wonder if the fact you're missing the "isBroadcast = $true" isn't causing an issue. Perhaps you need this directive to go along with the settings you have in broadcastSettings - dunno, I'm just guessing as this is squarely in the Graph domain (not PowerShell.)

     

     

    Cheers,

    Lain

    • webmasterSANTEE's avatar
      webmasterSANTEE
      Copper Contributor
      Great point. I felt like I was eating crazy pills!

      Now that I know that my BODY is alright. I will go over to the Graph section and seek assistance.

      Thank you so much for your time Lain! Have a fantastic weekend!
      ~WM

Resources