0

Context: I've been working with channels through GAS, Starting and Stopping them on a regular basis for the past few months to prevent overlaps. Now I'm migrating my services over to n8n and I've started using actual endpoints intstead of Advanced Libraries of GWS. I'm authorizing through GCP Credentials Oauth2 and start event works perfectly without a hitch.

After a few trial & errors, I've found the correct endpoint(https://www.googleapis.com/admin/reports_v1/channels/stop) for the channel stop request. But the request can't seem to find the ID that's been created a few moments ago from the same workflow and returning the following error message upon request.

Channel 'a1a308e1-740b-4201-be5d-83b0fbd505fa' not found for project 'xxxx'
  • The project ID is the project ID I'm auting my credentials on, that's correct.
  • Both the Start & Stop Requests are being sent from the same workflow with the exact same authentication.

Other similar questions seem to point out that the problem could be lying if the request is being sent to different projects as it has to stopped on the project it started from.

Some odditiy I've come across is that the "resourceId" for the request returned for the watch start request is exactly the same as the one I've used to use in my Google Apps Script project. I've tried to stop it from there but the same error has occured.

Question 1: What could I be doing wrong here? Question 2: Is there some sort of place on GCP or an endpoint that'd list out the active watch channels for the project or a Google Workspace environment?

Thank you,

Sved
  • 15
  • 3

1 Answers1

1

Answering my own question with the Solution:

Channel stop requests require the request to be under the same container, even if you are sending them within the "Body" of the request.

It has to be in the following format:

[Object: {"id": "asdasd-asd-asdd-asdd-qweqwea", "resourceId": "_AAssddwEq_A_Eaae_Ao"}]

Not using this method will result in a false positive as if google has actually gotten the ID properly and couldn't actually find it. In reality, it should've returned a non-complient request error.

Sved
  • 15
  • 3