I have an index.js file that is returning the body of an Eloqua REST obj using this code:
I have tried to use JSON.stringify
and this prettyJOSNStringify
var request = require('request');
var prettyJSONStringify = require('pretty-json-stringify');
request(
{
url : "https://secure.p03.eloqua.com/api/rest/2.0/assets/form/XXX",
headers : { "Authorization" : authenticationHeader }
},
function (error, response, body) {
console.log(prettyJSONStringify(body));
}
);
but the response in the console is just a huge blob of JSON, how do I clean this up?
{\"type\":\"Form\",\"currentStatus\":\"Draft\",\"id\":\"912\",\"createdAt\":\"1544810248\",\"createdBy\":\"35\",\"depth\":\"complete\",\"folderId\":\"5487\",\"name\":\"Let's Connect Web Form 3.0 - Vertical\",\"permissions\":[\"Retrieve\",\"Delete\",\"Update\"],\"updatedAt\":\"1545074293\",\"updatedBy\":\"35\",\"customCSS\":\" \/* RESET *\/.elq-form * { margin: 0; padding: 0;}.elq-form input,textarea {\u0009-webkit-box-sizing:content-box;\u0009-moz-box-sizing:content-box;\u0009box-sizing:content-box;}.elq-form input[type=text],.elq-form textarea,.elq-form select[multiple=multiple] {\u0009border: 1px solid #A6A6A6;} .elq-form button,input[type=reset],input[type=button],input[type=submit],input[type=checkbox],input[type=radio],select {\u0009-webkit-box-sizing:border-box;\u0009-moz-box-sizing:border-box;\u0009box-sizing:border-box;}\/* GENERIC *\/.elq-form input {\