Manipulating categories via GRAPI
-
I am trying to create calendar entries via GRAPI and assign them a category. If I create the entry with
payload = { "subject": subject, "start": { "dateTime": startDatetime.isoformat(), "timeZone": "CET" }, "end": { "dateTime": endDatetime.isoformat(), "timeZone": "CET" }, "location":{ "displayName": location }, "categories": [ 'CategoryName' ] }
no category is assigned, even though an identically named category exists and is selectable in the webapp. If I assign the category to an existing event via the webapp, and then pull the event out of GRAPI, the JSON looks like this:
{'@odata.etag': 'W/"IAptvLHWS1Wr2wmJEHAVY9kBAAA="', 'attendees': [], 'body': {'content': '', 'contentType': 'html'}, 'bodyPreview': None, 'categories': [], # <--- NO CATEGORIES 'changeKey': 'IAptvLHWS1Wr2wmJEHAVY9kBAAA=', 'createdDateTime': '2020-02-07T14:35:35Z', 'end': {'dateTime': '2020-02-07T12:20:00', 'timeZone': 'UTC'}, 'hasAttachments': False, 'iCalUId': None, 'id': 'ADAAAAAAAH2IZEfocUQFl4vY4E_EMtcBAAAABQAAAJNdYRan5EOuhIgy8oZqUm0AAAAA', 'importance': 'normal', 'isAllDay': None, 'isOrganizer': True, 'isReminderOn': False, 'lastModifiedDateTime': '2020-02-07T14:35:35Z', 'location': {'displayName': '3.11', 'locationType': 'default'}, 'onlineMeetingUrl': '', 'organizer': {'emailAddress': {'address': a@b.com', 'name': 'a.b'}}, 'recurrence': None, 'reminderMinutesBeforeStart': None, 'responseRequested': False, 'responseStatus': {'response': 'None', 'time': '0001-01-01T00:00:00Z'}, 'sensitivity': 'Normal', 'seriesMasterId': None, 'showAs': 'Unknown', 'start': {'dateTime': '2020-02-07T11:35:00', 'timeZone': 'UTC'}, 'subject': 'SUBJECT', 'type': 'singleInstance'}]}
The categories endpoint as defined by Graph is 404 and the COMPAT.md of GRAPI makes no mention of categories.
Am I missing something fundamental or is this not implemented? I’m grateful for any pointers.
rdd2
-
Hi,
setting categories is currently not supported via GRAPI. GRAPI responses return categories if they are set by other means.
Can you share some details of your use case to help us getting an understanding how GRAPI users want to use categories.
Thank you and best regards
Simon -
Hi Simon,
thanks for your answer. GRAPI seems not the way to go. I am building a tool to programmatically import a large number of events. Going to try the python-kopano route. Categories are working fine there.Are there any plans to implement setting categories via GRAPI?
Best regards
Thomas -
@rdd2 said in Manipulating categories via GRAPI:
Are there any plans to implement setting categories via GRAPI?
Yes - we add features to GRAPI as we need them for our apps or for customer projects.