TAdvCustomGTasks.GetTaskListItems always adding the key=XXXX into the URL

Dear TMS Support Team,

I was trying to use the TAdvCustomGTasks for the first time after having used the TAdvGCalendar for a long time. I removed my access tokens and asked GTasksDemo.dpr to get read and write access to the Google Tasks in my Google account. But the application never found a task list although it existed.

I checked the code of TAdvCustomGTasks.GetTaskListItems and found that it always adds the key=XXX to the URL even if I have an access token. According to the Google Task API you should not include the key in the URL if you have an access token (see also here). So I copied CloudCustomGTasks.pas into the project folder, added the unit to the project and changed the URL generation to:
url := 'https://www.googleapis.com/tasks/v1/users/@me/lists';
if Token_Access = string.Empty then
url := url + '?key=' + App.Key + '&maxResults=' + IntToStr(maxResults)
else
url := url + '?maxResults=' + IntToStr(maxResults);

Now I get my one and only task list back and the demo app finds the tasks I created via the browser upfront. :slightly_smiling_face:

Is this change of TAdvCustomGTasks.GetTaskListItems really required or am I missing something in the TMS VCL Cloud Pack source code?

Salut,
Mathias

Hi,

Thank you for letting us know.
The key parameter is indeed not needed. We'll look into fixing this in a future version.

Alternatively, you can use the TTMSFNCCloudGoogleTasks component, which is already working as expected. It's part of TMS FNC Cloud Pack (included with TMS All-Access), where our focus is going forward.

Hello Bart,

Thanks for your reply.

There is a list of methods that add a key into the URL although the header includes or may include an access token already:

  • TAdvCustomGTasks.GetTaskListItems
  • TAdvCustomGTasks.AddTaskList
  • TAdvCustomGTasks.DeleteTaskList
  • TGTaskListItem.UpdateTask
  • TGTaskListItem.DeleteTask
  • TGTaskListItem.GetTaskItems((const CompletedMin: TDateTime; ...)
  • TGTaskListItem.GetTaskItems(const ShowCompleted: boolean; ...)

I am looking forward to the new version.

Salut, Mathias

Hi Mathias,

Thank you for the detailed list. We’re aware that these methods also add the key parameter.

There's currently not ETA available for a new TMS VCL Cloud Pack version.
Please note that this issue doesn’t occur in TTMSFNCCloudGoogleTasks.