when created Teams schedule with Graph api as a "Online meeting", but it was created "personal schedule"

zaki 0 Reputation points
2024-08-29T10:30:51.4933333+00:00

I would like to create a teams schedule with Micorosoft Graph api as a "Online Meeting", but now it was created as the "personal schedule".

Microsoft Graph api code is created in Python. Teams schedule info write in json file and call function "requests.post()". To make it an Online meeting, the following code is settings were made. payload 'allowNewTimeProposals' is 'true' payload 'isOnlineMeeting' is 'true' payload 'onlineMeetingProvider' is 'teamsForBusiness'

But it was created as the "personal schedule". I would like to know why I cannot register my schedule in “Online Meeting”.

Following the code is Teams schedule code:

def post_web_meeting( organizer_mail, meeting_args_file):
        
    access_token = get_azure_access_token(organizer_mail)
    logger = get_logger( sys._getframe().f_code.co_name)
       
    # change string to lib
    meeting_args = json.loads( open_json( meeting_args_file))

    # initiallzation maillist
    attendees_mail_list = []

    # get a displayname of user         
    all_organization_user_dictionary_list = get_user_list(access_token)
    if all_organization_user_dictionary_list[ixs.STATUS] == ERROR:
        logger.error( "getting user list is failed.")
        sys.exit()
    all_organization_user_list = all_organization_user_dictionary_list[CONTENTS]
    
    # make a mailadress list of all user of groupe
    organization_mail_list = [ x['mail'] for x in all_organization_user_list]
    
    # get a displayname of Attendees user 
    attendees_list = []
    for attendees_mail in attendees_mail_list:
        attendees = {}
        attendees['emailAddress'] = {}
        attendees['emailAddress']['address'] = attendees_mail
        attendees['type'] = 'required'
        if attendees_mail in organization_mail_list:
            attendees['emailAddress']['name'] = [ _list['displayName'] for _list in all_organization_user_list if _list['mail'] == attendees_mail][0]
        else: 
            attendees['emailAddress']['name'] = attendees_mail
            
        attendees_list.append( attendees)

    # WebMeeting organizers
    organizer_id = get_user_id_by_mail( access_token, organizer_mail)

    # Setting WebMeeting Properties
    try:
        UsersPut_URL = 'https://graph.microsoft.com/v1.0/users/' + organizer_id + '/events'
    except:
        func_return_directory = create_ixsfunc_return_dictionary(ixs.ERROR, "The account does not have permission to access.", 800)
        return create_api_return_dictionary(func_return_directory )
    headers = {
        'Authorization': 'Bearer %s' % access_token,
        'Prefer': 'outlook.timezone=\"Asia/Tokyo\"',
        'Content-Type': 'application/json'
    }
    payload = {}
    
    payload['subject'] =  'Testmeenting'      
    payload['body'] = { 'contentType': 'HTML', 'content': meeting_args['subject']}
    payload['start'] = { 'dateTime': meeting_args['start'], 'timeZone': 'Asia/Tokyo'}
    payload['end'] = { 'dateTime': meeting_args['end'], 'timeZone': 'Asia/Tokyo'}
    payload['location'] = { 'displayName':meeting_args['subject']}
    payload['attendees'] = attendees_list
    payload['allowNewTimeProposals'] = 'true'
    payload['isOnlineMeeting'] = 'true'
    payload['onlineMeetingProvider'] = 'teamsForBusiness'

    # post Web Meeting
    response = requests.post(
        UsersPut_URL,
        headers = headers,
        data = json.dumps( payload)
    )

    #print("json.dumps( payload)")
    print(json.dumps( payload))
    response.close
    return_response = json.loads( response.text)
    #print("response.text")
    print(response.text)

JSON "meeting_args_file" info:

{
    "subject":" WebMeetingTest",
    "start": "2024-01-01T01:00:00",
    "end": "2024-01-01T01:30:00",
    "attendUsers":[]
}

  • Json file is same schedule info,But Teams schedule "Online Meeting" and "Personal schedule" depending on the account. This event has been observed frequently in accounts created after July 25, 2024 However, when using the Microsoft graph api to register a schedule, there are some accounts whose schedule is set to “personal schedule”. Even if an account is registered as a “Personal schedule”, it may be possible to create a new “Online meeting” by registering the schedule again after some time has passed.
  • If I check the last written print(json.dumps( payload)) to print(json.dumps( payload)) process, I could cofirme payload 'isOnlineMeeting' was changed from 'true' to 'false'.
  • Even with my account that is experiencing problems, I can register for an online meeting without any issues if I register for a meeting from the Teams application without using the Graph API.
Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
9,942 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,830 questions
Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
3,196 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.