Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 2
Message 1 of 2

Getting Error "Problems parsing JSON" while making POST call to create tree

{
"base_tree": "2267699d5ea2a632c625693ceef5f7b77b2cda74",
"tree": [
              {
                   "path": "synthetics/MyAccount-MakeAPayment.js",
                   "mode": "100644",
                    "type": "blob",
                    "content" : "require('new-relic-synthetics-manager');

"

               }

             ]

}

I have more lines to be included in the content property(more than 100 lines of the script which contains " and ').  Even at the first line, it is failing whenever there is a newline character. Please let me know how can I provide some scripts (javascript/selenium scripts) in the content property of the api call for creating a tree as mentioned in the documentation https://developer.github.com/v3/git/trees/#create-a-tree. Please note that I am trying to modify multiple files and commit all my changes at a single shot so won't be able to use  Content APi as mentioned in the documentation https://developer.github.com/v3/repos/contents/#create-a-file.
Some help at the earliest will be greatly appreciated.

Thanks in Advance

1 Reply
Community Manager
Message 2 of 2

Re: Getting Error "Problems parsing JSON" while making POST call to create tree

Hi,

 

Thanks for reaching out! And apologies about the delay. Are you still experiencing this issue?

Mark helpful posts with Accept as Solution to help other users locate important info. Don't forget to give Kudos for great content!