Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

CarlEOgden's avatar

How to access ID returned by Microsoft CreateEvent API

Hi

I'm trying to the ID from Microsoft API but struggling to get it!

I've DD'ed the response and it reads:-

"response" => Microsoft\Graph\Model\Event {#1217 ▼
    #_propDict: array:43 [▼
    "id" => "id_response"

How do I access this?

TIA Carl.

0 likes
2 replies
Sinnbeck's avatar

And the code?

Does this work?

$response['id'];
//or
$response->id;
//or
$response->getProperties()['id'];
CarlEOgden's avatar
CarlEOgden
OP
Best Answer
Level 4

@Sinnbeck it comes back as an object, looking at Microsofts example code, I've worked out that $response->getId(); returns the Id

Problem solved, onwards to the next one lol

Regards Carl.

Please or to participate in this conversation.