cancel
Showing results for 
Search instead for 
Did you mean: 
SOLVED

JSON pars error for https://{{ip}}/{{command}}

JSON pars error for https://{{ip}}/{{command}}

xLujumajo
New Poster

EDIT: by @CodeShepherd  Moved to own topic from this one.

Hello,

Thanks for the sharing.

I tried it and I have an issue at the JSON parsing . The initial URL was : https://{{ip}}/{{{command}}} I changed it to https://{{ip}}/{{command}} 

This doesn't seem to work, it returns statuscode 200 and I still get a "JSON parse error"

xLujumajo_0-1669282822576.png

I'm on a Virtual Core do you have a solution?

4 REPLIES 4

CodeShepherd
Community Moderator
Community Moderator

Could you share your nodes so we can do some tests?

Yes of course.

Please rename .txt to .json

I tried to get trough all of this and I found that it was a little bit confusing. Because I normally simply use function to put the message together and use a generic http request.

Did you try to use three brackets each "https://{{{ip}}}/{{{command}}}"? I now other nodes behave like this.

We could also have a short online meeting if you like. Please send me a private message with your contact data then.

I had a deeper look and found that your code simply asks for the html code at a node on the datalayer. This is also given back, but the JSON parser cannot interpret this as a JSON object so you get the error shown.

ctrlX Node-RED customer flow JSON parse errorctrlX Node-RED customer flow JSON parse error

Please have a look to the blog post "Using REST API of ctrlX CORE" to see how the basics work.

Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist