-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Manual Request Doesn't Allow For All Methods #12
Comments
Could you point to the public API documentation of the action/endpoint you're trying to use? I didn't memorize the entire API surface, but I don't recall using a patch for anything. |
Good Afternoon,
Here is the public API endpoint:
https://developers.egnyte.com/docs/read/Folder_Options_API
I was attempting to use the Egnyte SDK so I would assume that all required headers are included.
const descr = `folder_description:${
data.project_number
} | ${data.project_stage.name.toUpperCase()}`;
client.API.manual.sendRequest(
{
url: `${egn_url}/pubapi/v1/fs${path}`,
headers: {},
params: {},
method: "PATCH",
body: descr,
},
function (error) {
if (error === null) {
console.log("Description Updated.");
} else {
console.log(error);
}
},
);
You can see my axios request includes the minimum headers required.
try {
await axios.patch(
`${egn_url}/pubapi/v1/fs${urlPath}`,
{
folder_description: `${jobNo} | ${status}`,
},
{ headers: { authorization: `Bearer ${egn_token}` } },
);
console.log("Folder Description Updated.");
} catch (err) {
console.log(err);
}
I appreciate your help on this.
[cid:5bd89cb5-e904-4699-9abf-154107af2483]
Kajima Building & Design Group, Inc.
Neil Lovelace
Technology Manager
O 404.812.8600 | 3411
C 470.728.7089
Building our client’s SUCCESS one project at a time
***@***.***> CHAT ***@***.***/bookings/> MEET ***@***.***/bookings/>
…________________________________
From: Zbyszek Tenerowicz ***@***.***>
Sent: Tuesday, April 13, 2021 7:51 AM
To: egnyte/egnyte-js-sdk ***@***.***>
Cc: Lovelace, Neil <[email protected]>; Author ***@***.***>
Subject: Re: [egnyte/egnyte-js-sdk] Manual Request Doesn't Allow For All Methods (#12)
[EXTERNAL SENDER]: Use Caution. Do not click links or open attachments unless you recognize the sender and know the content is safe.
Could you point to the public API documentation of the action/endpoint you're trying to use? I didn't memorize the entire API surface, but I don't recall using a patch for anything.
As for the error - unsupported media type means content-type doesn't have an acceptable value.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fegnyte%2Fegnyte-js-sdk%2Fissues%2F12%23issuecomment-818710387&data=04%7C01%7Cnlovelace%40kbd.group%7Ce5dec8ef9bc54e21271308d8fe7ae73f%7C74983c0872ee43e0a97249076fefbfe3%7C0%7C0%7C637539151120408118%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=TmHX%2Bn4AqH7ONOdo4YWFK%2F48cuCqypoMtOHbI%2FUaZH0%3D&reserved=0>, or unsubscribe<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FALQ7MK2EFANPLVJK4AAPFBDTIQ46JANCNFSM422E7BPA&data=04%7C01%7Cnlovelace%40kbd.group%7Ce5dec8ef9bc54e21271308d8fe7ae73f%7C74983c0872ee43e0a97249076fefbfe3%7C0%7C0%7C637539151120408118%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=7zFKQM6WvE%2FBIDiL%2BCYtQO4D0rGmtpg8lbz%2F2UyfIEA%3D&reserved=0>.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Attempting to send a manual request using 'PATCH' method. The error returned states 'Unsupported Media Type'. As you can see from my code below, I'm sending a templated string as my body. Otherwise there is no other media.
const descr =
folder_description: ${data.project_number} | ${data.project_stage.name.toUpperCase()}
;egnyte.API.manual.sendRequest(
{
url:
${egn_url}/pubapi/v1/fs${path}
,headers: {},
params: {},
method: "PATCH",
body: descr,
},
function (error) {
if (error === null) {
console.log("Description Updated.");
} else {
console.log(error);
}
});
The text was updated successfully, but these errors were encountered: