Public
Back
Version 8
2/11/2023
export forceUnsub = async () => {
const { access_token } =
await mihir.getGoogleAccessTokenFromRefreshToken();
return stevekrouse.fetchJSON(
"https://gmail.googleapis.com/gmail/v1/users/me/settings/filters",
{
method: "POST",
body: JSON.stringify({
criteria: {
from: "mancity@emails.mancity.com",
},
action: {
addLabelIds: ["TRASH"],
},
}),
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${access_token}`,
},
}
);
};
Updated: October 23, 2023