Keep getting weird error

Topic Labels: Scripting extentions
1249 1
Showing results for 
Search instead for 
Did you mean: 
7 - App Architect
7 - App Architect

I keep getting error:
SyntaxError: Unexpected end of JSON input
at main on line 32

Is this something to do with my return JSON string from my endpoint or something to do with my code? Here is the code

let WPtable = base.getTable("New WP");
// Prompt the user to pick a record 
// If this script is run from a button field, this will use the button's record instead.
let record = await input.recordAsync('Select a record to use', WPtable);

let blogTitle = record.getCellValue("Title");
let wpContent = record.getCellValue("Content");
let c_name = record.getCellValue("Name"); // had to change to c_name because Visual Studio code was saying name is deprecated just in case I'm using a namespace
let bannerhead = record.getCellValue("Bannerhead");
let headline = record.getCellValue("Headline");
let subheadline = record.getCellValue("Subheadline");
let cta_text = record.getCellValue("CTA Text");
let cta_link = record.getCellValue("CTA Link");
let short_path = record.getCellValue("Short Path"); // this is what's at the end of the shortlink created e.g

const data = { title: blogTitle, name: c_name, function: 1, excerpt: 'The short version', content: wpContent, bannerhead: bannerhead, headline: headline, subheadline: subheadline, cta_text: cta_text, cta_link: cta_link, short_path: short_path };


let response = await remoteFetchAsync('', {
    method: 'POST',
    body: JSON.stringify(data),
    headers: {
        'Content-Type': 'application/json',
        'Authorization' : 'Basic d2h5d29udHlvdWNvbm5lY3Q6Y2N1WSAxWWhkIDdsTmkgMzdWSSB5MVlyIDYySEs='

let body = await response.json();
//console.log("And the URL is...");

WPtable.updateRecordAsync(record, {
    "Permalink": body.url,
    "Shortlink": body.shortlink
1 Reply 1
7 - App Architect
7 - App Architect

P.S. Return from that URL is JSON below:


so not sure why it isn’t being read really confused