Example commands (*) that you can use to validate proxy behavior against the Google Workspace APIs. Follow the steps and change the values to match your configuration when needed.
You can use the -i
flag to impersonate the desired user identity option when running the testing tool. Example:
Copy node tools/psoxy-test/cli-call.js -u [your_psoxy_url]/psoxy-gcal/calendar/v3/calendars/primary -i you@acme.com
For AWS, change the role to assume with one with sufficient permissions to call the proxy (-r
flag). Example:
Copy node tools/psoxy-test/cli-call.js -u [your_psoxy_url]/psoxy-gcal/calendar/v3/calendars/primary -r arn:aws:iam::PROJECT_ID:role/ROLE_NAME
If any call appears to fail, repeat it using the -v
flag.
(*) All commands assume that you are at the root path of the Psoxy project.
Calendar
Copy node tools/psoxy-test/cli-call.js -u [your_psoxy_url]/psoxy-gcal/calendar/v3/calendars/primary
Settings
Copy node tools/psoxy-test/cli-call.js -u [your_psoxy_url]/psoxy-gcal/calendar/v3/users/me/settings
Events
Copy node tools/psoxy-test/cli-call.js -u [your_psoxy_url]/psoxy-gcal/calendar/v3/calendars/primary/events
Event
Get the calendar event ID (accessor path in response .items[0].id
):
Copy node tools/psoxy-test/cli-call.js -u [your_psoxy_url]/psoxy-gcal/calendar/v3/calendars/primary/events
Get event information (replace calendar_event_id
with the corresponding value):
Copy node tools/psoxy-test/cli-call.js -u [your_psoxy_url]/psoxy-gcal/calendar/v3/calendars/primary/events/[calendar_event_id]
Directory
Domains
Copy node tools/psoxy-test/cli-call.js -u [your_psoxy_url]/psoxy-gdirectory/admin/directory/v1/customer/my_customer/domains
Groups
Copy node tools/psoxy-test/cli-call.js -u [your_psoxy_url]/psoxy-gdirectory/admin/directory/v1/groups ? customer = my_customer
Group
Get the group ID (accessor path in response .groups[0].id
):
Copy node tools/psoxy-test/cli-call.js -u [your_psoxy_url]/psoxy-gdirectory/admin/directory/v1/groups ? customer = my_customer
Get group information (replace google_group_id
with the corresponding value):
Copy node tools/psoxy-test/cli-call.js -u [your_psoxy_url]/psoxy-gdirectory/admin/directory/v1/groups/[google_group_id]
Group Members
Copy node tools/psoxy-test/cli-call.js -u [your_psoxy_url]/psoxy-gdirectory/admin/directory/v1/groups/[google_group_id]/members
Users
Copy node tools/psoxy-test/cli-call.js -u [your_psoxy_url]/psoxy-gdirectory/admin/directory/v1/users ? customer = my_customer
Get the user ID (accessor path in response .users[0].id
):
Copy node tools/psoxy-test/cli-call.js -u [your_psoxy_url]/psoxy-gdirectory/admin/directory/v1/users ? customer = my_customer
Get user information (replace [google_user_id] with the corresponding value):
Copy node tools/psoxy-test/cli-call.js -u [your_psoxy_url]/psoxy-gdirectory/admin/directory/v1/users/[google_user_id]
Thumbnail (expect have its contents redacted; replace [google_user_id] with the corresponding value):
Copy node tools/psoxy-test/cli-call.js -u [your_psoxy_url]/psoxy-gdirectory/admin/directory/v1/users/[google_user_id]/photos/thumbnail
Roles
Copy node tools/psoxy-test/cli-call.js -u [your_psoxy_url]/psoxy-gdirectory/admin/directory/v1/customer/my_customer/roles
Copy node tools/psoxy-test/cli-call.js -u [your_psoxy_url]/psoxy-gdirectory/admin/directory/v1/customer/my_customer/roleassignments
Drive
Files
API v2
Copy node tools/psoxy-test/cli-call.js -u [your_psoxy_url]/psoxy-gdrive/drive/v2/files
API v3 (*)
Copy node tools/psoxy-test/cli-call.js -u [your_psoxy_url]/psoxy-gdrive/drive/v3/files
(*) Notice that only the "version" part of the URL changes, and all subsequent calls should work for v2
and also v3
.
File
Get the file ID (accessor path in response .files[0].id
:
Copy node tools/psoxy-test/cli-call.js -u [your_psoxy_url]/psoxy-gdrive/drive/v2/files
Get file details (replace [drive_file_id] with the corresponding value):
Copy node tools/psoxy-test/cli-call.js -u [your_psoxy_url]/psoxy-gdrive/drive/v2/files/[drive_file_id] ? fields = *
File Revisions
YMMV, as file at index 0
must actually be a type that supports revisions for this to return anything. You can play with different file IDs until you find something that does.
Copy node tools/psoxy-test/cli-call.js -u [your_psoxy_url]/psoxy-gdrive/drive/v2/files/[drive_file_id]/revisions
Copy node tools/psoxy-test/cli-call.js -u [your_psoxy_url]/psoxy-gdrive/drive/v2/files/[drive_file_id]/revisions ? pageSize = 2 & fields = *
Permissions
Copy node tools/psoxy-test/cli-call.js -u [your_psoxy_url]/psoxy-gdrive/drive/v2/files/[drive_file_id]/permissions
Copy node tools/psoxy-test/cli-call.js -u [your_psoxy_url]/psoxy-gdrive/drive/v2/files/[drive_file_id]/permissions ? fields = *
YMMV, as file at index 0
must actually be a type that has comments for this to return anything. You can play with different file IDs until you find something that does.
NOTE probably blocked by OAuth metadata only scope!!
Copy node tools/psoxy-test/cli-call.js -u [your_psoxy_url]/psoxy-gdrive/drive/v2/files/[drive_file_id]/comments
Copy node tools/psoxy-test/cli-call.js -u [your_psoxy_url]/psoxy-gdrive/drive/v2/files/[drive_file_id]/comments ? fields = *
NOTE probably blocked by OAuth metadata only scope!!
Get file comment ID (accessor path in response .items[0].id
):
Copy node tools/psoxy-test/cli-call.js -u [your_psoxy_url]/psoxy-gdrive/drive/v2/files/[drive_file_id]/comments
Get file comment details (replace file_comment_id
with the corresponding value):
Copy node tools/psoxy-test/cli-call.js -u [your_psoxy_url]/psoxy-gdrive/drive/v2/files/[drive_file_id]/comments/[file_comment_id]
Replies
NOTE probably blocked by OAuth metadata only scope!!
YMMV, as above, play with the file comment ID value until you find a file with comments, and a comment that has replies.
Copy node tools/psoxy-test/cli-call.js -u [your_psoxy_url]/psoxy-gdrive/drive/v2/files/[drive_file_id]/comments/[file_comment_id]/replies
GMail
Messages
Copy node tools/psoxy-test/cli-call.js -u [your_psoxy_url]/psoxy-gmail/gmail/v1/users/me/messages
Message
Copy node tools/psoxy-test/cli-call.js -u [your_psoxy_url]/psoxy-gmail/gmail/v1/users/me/messages/[gmail_message_id] ? format = metadata
Google Chat
NOTE: limited to 10 results, to keep it readable.
Copy node tools/psoxy-test/cli-call.js -u [your_psoxy_url]/psoxy-google-chat/admin/reports/v1/activity/users/all/applications/chat ? maxResults = 10
Google Meet
NOTE: limited to 10 results, to keep it readable.
Copy node tools/psoxy-test/cli-call.js -u [your_psoxy_url]/psoxy-google-chat/admin/reports/v1/activity/users/all/applications/meet ? maxResults = 10
Last updated 3 months ago