Update Sell client-side app settings
Hello,
I am developing a Sell client-side app using ZAF. I would like to save a state in app settings to sync across all app users.
The challenge is when I try to call the update app installation end point. Here is a sample snippet
async function updateAppSettings(key, value) {
const payload = {
settings: {
[key]: value,
},
};
const request = {
url: `https://${subdomain}.zendesk.com/api/sell/apps/installations/${installationId}.json`,
method: "PUT",
headers: {
Authorization: "Bearer {{setting.ticketingApiToken}}",
},
secure: true,
data: JSON.stringify(payload),
contentType: "application/json",
dataType: "json",
};
await client.request(request).then(
(res) => {
log(res, "info", "Success");
},
(err) => {
log(err, "danger", "Error updating app settings");
}
);
}
This results is error:
403: Proxy error: URI is not proxyable
The token is a Support OAuth token with apps:read apps:write access authorized by an admin and stored as an app secure parameter.
Any help would be appreciated
Update:
I wanted to add that I read this article and I can confirm I am not trying to access a different instance. In fact, the variable {subdomain} is the one returned by the app context.
-
Hey Ahmed,
I haven't been able to replicate your issue. Are you passing in any other information as a secure parameter?
Thanks!
-
Hi Eric Nelson
I am not passing any other secure parameters. I have created a minimal reproducible example repo here.
-
Hey Ahmed,
Thanks for sending this over. I've been able to reproduce your issue, though it's been inconsistent. I'm syncing up with the team who owns the sell portion of the apps framework to see if they already have this bug reported. As soon as I have some more details on next steps, I'll let you know.
Thanks!
-
Thanks Eric. Much appreciated.
Por favor, entrar para comentar.
4 Comentários