Google calendar API return conference data as pending

Viewed 448

When we create an event using google calendar API, it would not return hangout link in some cases, but return the status as pending.

"conferenceData": {
    "createRequest": {
        "requestId": "kavprurmn7h34jxcq6vgiufs2k",
        "conferenceSolutionKey": {
            "type": "hangoutsMeet"
        },
        "status": {
            "statusCode": "pending"
        }
    }
},

I would assume that Google would return the Hangout link if we try to get the event after some time. The challenge is how to test this scenario. It is hard to reproduce this issue when you need to test, but the issue happens once in a while in production. How do we test this ? Is there a way to simulate this API behavior?

1 Answers

If the event is still pending not all information might be available. You have to try to get it until the event status is success.

In this situation you should use exponential backoff to try to get the Hangouts link. This prevents making unnecessary calls that may fill your quota or throttle your network. To accomplish this on Javascript, as an example, you can use .setTimeout(). Feel free to ask any question to expand this answer.

Related