import requests
contacts_data = {
"givenName": "Pavel",
"surname": "Bansky",
"emailAddresses": [
{
"address": "pavelb@fabrikam.onmicrosoft.com",
"name": "Pavel Bansky"
}
],
"businessPhones": [
"+1 732 555 0102"
]
}
r = requests.post('https://graph.microsoft.com/v1.0/me/contacts', json=contacts_data)