There are a couple of things here. I would recommend learning how to use cURL instead of file_get_contents
. In August, we’re requiring that developers send the Client-ID on their request and file_get_contents
can’t add that header properly. This thread should help with learning how to use cURL.
For your other question, you’re indexing into something that doesn’t exist here:
$team = $data['_links']['self']['teams']['_links']['display_name'];
If you read that, you’re looking into the response data for the _links
property with the self
property with the teams
property, etc. etc. Now, compare that to the documentation here. In those docs, it shows that the API response has a teams
array with an object inside that has the display_name
. You’re trying to access a property that doesn’t exist.