0

I am creating G-Suite add-on to integrate 3rd part conference solution with Google Calendar events. I added chosen 3rd party Conference Solution to manifest file:

{
  "timeZone": "America/Denver",
  "dependencies": {
    "enabledAdvancedServices": [{
      "userSymbol": "Calendar",
      "serviceId": "calendar",
      "version": "v3"
    }]
  },
  "exceptionLogging": "STACKDRIVER",
  "oauthScopes": [
    "https://www.googleapis.com/auth/userinfo.email",
    "https://www.googleapis.com/auth/admin.directory.user.readonly",
    "https://www.googleapis.com/auth/calendar",
    "https://www.googleapis.com/auth/calendar.addons.execute",
    "https://www.googleapis.com/auth/calendar.addons.current.event.read",
    "https://www.googleapis.com/auth/calendar.addons.current.event.write"
  ],
  "urlFetchWhitelist": [],
  "runtimeVersion": "V8",
  "addOns": {
    "common": {
      "name": "Conference Solution",
      "logoUrl": "https://imagesite.com/companyLogo",
      "layoutProperties": {
        "primaryColor": "#4285f4",
        "secondaryColor": "#ea4335"
      },
      "homepageTrigger": {
        "runFunction": "onHomePage"
      }
    },
    "calendar": {
      "homepageTrigger": {
        "runFunction": "onHomePage"
      },
      "eventOpenTrigger": {
        "runFunction": "onCalendarEventOpen"
      },
      "eventUpdateTrigger": {
        "runFunction": "calendarUpdated"
      },
      "currentEventAccess": "READ_WRITE",
      "conferenceSolution": [{
        "onCreateFunction": "createConference",
        "id": "123",
        "name": "Meeting Conference Solution",
        "logoUrl": "https://someUrl.com/conferenceSolutionLogo.jpg"
      }]
}

But when I choose my 3rd part conference solution, I get 500 code of response and error that conference cannot be created.

UPD. Response body:

[13,"Internal error encountered."]

Request URL:

https://calendar-pa.clients6.google.com/v1/calendar/polzovatel101056@gmail.com/event/2lhlppothipf43ggb9krfabcef/conferencing?alt=protojson&key=AIzaSyAJV0pH9dpVwdNZeLajIGsIpjcPu3tVgAE

Request body:

[
  [ 
    "email@gmail.com",
    "2lhlppothipf43ggb9krfabcef"
  ],
  null,
  null,
  [ 
    4,
    [ 
      null,
      "AKfycbzrJeytVGp3C8hhST2QMETrVdaXPG84CNnIXRQtwJUv",
      "1"
    ]
  ]
]

createConference function:

function createConference(e) {
  var dataBuilder = ConferenceDataService.newConferenceDataBuilder();
  var confParams = dataBuilder.newConferenceParameter()
    .setKey('conferenceId')
    .setValue('addOn');

  confParams.setKey("key")
    .setValue(JSON.stringify({
      type: "addOn"
    }));

  dataBuilder.setConferenceSolutionId("123");
  dataBuilder.setParameters(confParams);
  return dataBuilder.build();
}
Rafa Guillermo
  • 14,474
  • 3
  • 18
  • 54
  • Can you please post the full error? – Rafa Guillermo Apr 13 '20 at 10:12
  • @RafaGuillermo, I updated post. Is it enough? – Ilia Yanovoy Apr 13 '20 at 10:45
  • Error 400 and Internal error do not correspond with one another; are you sure these aren't two different errors? 400 implies there's a permission/forbidden access issue whereas Internal errors are 5XX. – Rafa Guillermo Apr 13 '20 at 14:22
  • @RafaGuillermo, You are totally right. My mistake. I found that I had an error of execution, and after that I get 500 instead of 400. I edited my question. Sorry to confuse. – Ilia Yanovoy Apr 14 '20 at 08:28
  • Can you share your whole script? The call you're making and how you're making it, I can't understand your request body without knowing the methods you call. – Rafa Guillermo Apr 14 '20 at 10:28
  • @RafaGuillermo, I am not send request directly. It is built in Calendar functionality. I just added new option for dropdown of conference solutions in manifest. – Ilia Yanovoy Apr 14 '20 at 12:56
  • Why are you trying to do this in the manifest? Where have you found the documentation for this? – Rafa Guillermo Apr 14 '20 at 13:34
  • @RafaGuillermo https://developers.google.com/gsuite/add-ons/how-tos/upgrade-addons#calendar_conferencing_add-ons And, also, looks like ZOOM and Webex AddOns works in similar way. Because I can choose my conference solution from Calendar Dropdaown, as wrote in requirments – Ilia Yanovoy Apr 14 '20 at 13:57
  • The [Calendar manifest resource](https://developers.google.com/apps-script/manifest/calendar-addons) doesn't specify `conferenceSolution` as a field. What is your workflow? What are you trying to achieve here? – Rafa Guillermo Apr 20 '20 at 13:34
  • @RafaGuillermo I am trying to create Add-on which add 3rd part conference solution like ZOOM or Webex. Here [link](https://developers.google.com/gsuite/add-ons/how-tos/upgrade-addons#calendar_conferencing_add-ons) wrote we have array of conferenceSolutions in manifest file. – Ilia Yanovoy Apr 21 '20 at 08:41
  • Is this a third party solution created by you? – Rafa Guillermo Apr 21 '20 at 09:12
  • @RafaGuillermo, no, It isn't mine. But how it affect to undocumented features? – Ilia Yanovoy Apr 21 '20 at 09:50
  • Sorry, [I misread some documentation](https://developers.google.com/gsuite/add-ons/concepts/types#calendar_conferencing_add-ons). Could you share the code for the card that has the dropdown in your add-on? And can you explain the workflow of your add-on? I want to try and reproduce in my environment. – Rafa Guillermo Apr 21 '20 at 10:53
  • @RafaGuillermo, no problem. I just add code above to manifest and get new item in conference solution list, when I create new event in my calendar [screenshot](https://drive.google.com/file/d/1PzQe3r3N2fduUpjwpVlmlutu_sbjLbnE/view?usp=sharing) But, when I choose my conference solution, I get error above. – Ilia Yanovoy Apr 21 '20 at 13:04
  • Have you got the conference add-on installed? – Rafa Guillermo Apr 21 '20 at 13:11
  • @RafaGuillermo, my conference add-on, which I creates, or which one? – Ilia Yanovoy Apr 21 '20 at 14:18
  • The conference add-on; like you have Zoom there in a dropdown, [do you have your third-party conference add-on installed](https://gsuite.google.com/marketplace/category/works-with-calendar)? – Rafa Guillermo Apr 21 '20 at 14:20
  • @RafaGuillermo, it is my target. I want to create add-on like ZOOM – Ilia Yanovoy Apr 21 '20 at 14:35
  • I don't understand `it is my target`. What is your third party conference solution? Is it installed for your domain? – Rafa Guillermo Apr 21 '20 at 14:50
  • @RafaGuillermo, `it is my target`, I mean, that it is my task. Where I should install it? I have native app, and have API to create event in my conference solution. Is it enough? – Ilia Yanovoy Apr 21 '20 at 15:06
  • But your manifest isn't specifying *what* to do when you select your conference solution; you're only providing it a name and a logo. It's up to the the conference solution provider to have G Suite integration for you to be able to use this as a feature. If, for example, you want to have a drop-down for Zoom, you *must* install the [Zoom for G Suite addon](https://gsuite.google.com/marketplace/app/zoom_for_gsuite/364750910244). You have to do the same for your other conference solution is. – Rafa Guillermo Apr 21 '20 at 15:09
  • @RafaGuillermo thank you for you support and response. In manifest file I wrote `"onCreateFunction": "createConference"` and I don't know what G-Suite wants to get from `createConference` function. Where I can read, how to handle createConference event correctly? – Ilia Yanovoy Apr 21 '20 at 15:27
  • Where are you finding the documentation for `onCreateFunction`? – Rafa Guillermo Apr 21 '20 at 15:39
  • @RafaGuillermo, I found it in question on StackOverflow [question](https://stackoverflow.com/questions/60928984/referenceerror-conferencedataservice-is-not-defined). But I cannot find it in G-suite documentation. – Ilia Yanovoy Apr 21 '20 at 15:58
  • As I mentioned before, `conferenceSolutions` in manifest is exist, but without any information or types. – Ilia Yanovoy Apr 21 '20 at 15:59
  • Are you developing a full Calendar conference add-on? Please provide your code for your `createConference` function. You should be using this in conjunction with the [Conference Data Service](https://developers.google.com/apps-script/reference/conference-data) of Apps Script. – Rafa Guillermo Apr 22 '20 at 08:51
  • @RafaGuillermo, I planned to use that [code](https://snipit.io/lists/10452/32314) but I get error `ReferenceError: ConferenceDataService is not defined` as [SO question](https://stackoverflow.com/questions/60928984/referenceerror-conferencedataservice-is-not-defined) – Ilia Yanovoy Apr 22 '20 at 09:33
  • I can't see this snipit, please update your question with the relevant code. – Rafa Guillermo Apr 22 '20 at 09:35
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/212401/discussion-between-rafa-guillermo-and-ilia-yanovoy). – Rafa Guillermo Apr 24 '20 at 07:12

1 Answers1

1

This appears to be a bug!

After fully understanding you situation I reproduced your code an the behaviour you're describing seems to be unintended behaviour. After setting up an add-on to create a conference via a third-party conference solution and selecting it from the drop-down:

enter image description here

The conference fails to be run and the following error can be seen in the Stackdriver logs:

ReferenceError: ConferenceDataService is not defined.

I did a search and it seems that there is already a report on Google's Issue Tracker which detail the same kind of behaviour:

Google does seem to know about this issue but you can hit the ☆ next to the issue number in the top left on the aforementioned page which lets Google know more people are encountering this and so it is more likely to be seen to faster.


Update 2020.04.24:

It seems that this has been fixed on Google's end as per a comment left on the above Issue Tracker link. To confirm I checked the method from within the Apps Script interface and low-and-behold method suggestions are now being populated:

enter image description here

Nimantha
  • 6,405
  • 6
  • 28
  • 69
Rafa Guillermo
  • 14,474
  • 3
  • 18
  • 54
  • It seems there was a change this morning on the linked Issue Tracker issue and this now works. I have updated my answer to reflect this. @IlyaYanovoy – Rafa Guillermo Apr 24 '20 at 07:10