Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

155
Views
Javascript error saying that I do not provide an API token

Can someone take a look at the code below. I try to make a converter work, which makes a png from a jpg. I keep getting this error: {"message":"Please provide an API key or token."}

This is the code:

const {
file,
filename,
mimetype,
token,
size,
folderid,
} = inputs;
 
var myHeaders = new Headers();
myHeaders.append("x-oc-api-key", "API KEY");
myHeaders.append("Content-Type", "application/json");
 
var raw = {
 type: 'remote',
 source: file}
 conversion: {
 target: 'png'}
 
var requestOptions = {
 method: 'POST',
 headers: myHeaders,
 body: raw,
 redirect: 'follow'
};
 
 
 const {url} = inputs;
try {
 const response = await fetch("www.apiwebsite.com/jobs", requestOptions);
 const outputvariableurl = await response.json();
 return { outputvariableurl }
} catch (err) {
 const error = {
   code: 'unknownError',
   message: 'Something went wrong.',
   rawError: err,
 } 
 return [1, { error }]
}
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!