Webhook payload comes with header info

Greetings!

I just started using node-red about a week ago with Home Assistant.

I had a webhook payload coming from Plex, however, I'm trying to convert it to an object or just use the JSON data, however, in the debug it posts as a string. I'm not sure how to just have it be the JSON payload message and ignore/remove the header. Here's the JSON payload:


--------------------------f572fe742d0de0c6
Content-Disposition: form-data; name="payload"
Content-Type: application/json

{
   "event":"media.stop",
   "user":true,
   "owner":true,
   "Account":{
      "id":4657934,
      "thumb":"https://plex.tv/users/df084946835de8f9/avatar?c=1642469099",
      "title":"xxxxxx"
   },
   "Server":{
      "title":"Raspberry",
      "uuid":"xxxxxxxxxxxxxxxxxxxxxxxx"
   },
   "Player":{
      "local":true,
      "publicAddress":"xxxxxxxxxxxxxxxxxx",
      "title":"iPhone",
      "uuid":"A075E89D-1830-4D84-9A47-616E884F6835"
   },
   "Metadata":{
      "librarySectionType":"movie",
      "ratingKey":"18154",
      "key":"/library/metadata/18154",
      "guid":"plex://movie/5d7768282e80df001ebdcebb",
      "studio":"Paramount",
      "type":"movie",
      "title":"Top Gun",
      "librarySectionTitle":"Movies",
      "librarySectionID":1,
      "librarySectionKey":"/library/sections/1",
      "contentRating":"PG",
      "summary":"\"As students ....
    }
}

Any help would be greatly appreciated!

Hi and Welcome.

If it is a return from a http request, you can set the request node to return a parse JSON object in the nodes settings.
If it is a payload from a http in node you can pass it through a Json node.

So in the webhook node, this is what's in it. If I choose headers then it passes the header data. Tried other options and none give me just the JSON body.

When I run it through JSON, I get this error:

msg : string[39]

"Unexpected number in JSON at position 1"

You would need to remove the fist few lines up to the first {, you could just split on application/json and return index 1
e.g.

[{"id":"be1f1fbc9d72170b","type":"inject","z":"06afa4f2be886b2e","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":320,"y":300,"wires":[["8a34bde7b0fd2665"]]},{"id":"8a34bde7b0fd2665","type":"template","z":"06afa4f2be886b2e","name":"simulate webhook payload","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"--------------------------f572fe742d0de0c6\nContent-Disposition: form-data; name=\"payload\"\nContent-Type: application/json\n\n{\n   \"event\":\"media.stop\",\n   \"user\":true,\n   \"owner\":true,\n   \"Account\":{\n      \"id\":4657934,\n      \"thumb\":\"https://plex.tv/users/df084946835de8f9/avatar?c=1642469099\",\n      \"title\":\"xxxxxx\"\n   },\n   \"Server\":{\n      \"title\":\"Raspberry\",\n      \"uuid\":\"xxxxxxxxxxxxxxxxxxxxxxxx\"\n   },\n   \"Player\":{\n      \"local\":true,\n      \"publicAddress\":\"xxxxxxxxxxxxxxxxxx\",\n      \"title\":\"iPhone\",\n      \"uuid\":\"A075E89D-1830-4D84-9A47-616E884F6835\"\n   },\n   \"Metadata\":{\n      \"librarySectionType\":\"movie\",\n      \"ratingKey\":\"18154\",\n      \"key\":\"/library/metadata/18154\",\n      \"guid\":\"plex://movie/5d7768282e80df001ebdcebb\",\n      \"studio\":\"Paramount\",\n      \"type\":\"movie\",\n      \"title\":\"Top Gun\",\n      \"librarySectionTitle\":\"Movies\",\n      \"librarySectionID\":1,\n      \"librarySectionKey\":\"/library/sections/1\",\n      \"contentRating\":\"PG\"\n      \n    }\n}","output":"str","x":520,"y":300,"wires":[["d70869d59e950518"]]},{"id":"d70869d59e950518","type":"change","z":"06afa4f2be886b2e","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"$split($$.payload, \"Content-Type: application/json\")[1]","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":540,"y":340,"wires":[["90671cea274db923"]]},{"id":"90671cea274db923","type":"json","z":"06afa4f2be886b2e","name":"","property":"payload","action":"","pretty":false,"x":710,"y":340,"wires":[["83dfbceff9236cd0"]]},{"id":"83dfbceff9236cd0","type":"debug","z":"06afa4f2be886b2e","name":"debug 100","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":850,"y":340,"wires":[]}]

Weird, I'm getting this error now:
"Unexpected number in JSON at position 6934"

I also didn't post the full JSON payload, but that shouldn't matter, right? because it's just removing the first few lines.

Your payload is truncated, as the debug only show first 1000 characters of the payload string. Try it on the payload from the webhook payload directly.

If that is the return of the webhook , then to will need to replace the ....at end and replace it with a "

You're saying add the

$split($$.payload, "Content-Type: application/json")[1]

In the node that has the webhook URL? how would I do that?

You are right, it's truncated (...), there is def more info in that payload.

No, I'm saying delete the template node in my example, and place your webhook node there.

Gotcha, yea, that's what I did and it gave me the error. I imported your sequence and replaced the template with my webhook (also removed the timestamp).

That's how I set it up when I got the initial error. Unless I'm still misunderstanding...

Then we need to see the payload in full. You can use the debug to log it to console, or you can save it to file using the file write node.

good call, this is the full output:

-- -- -- -- -- -- -- -- -- -- -- -- --bdb1266bd886aac4
Content - Disposition: form - data;
name = "payload"
Content - Type: application / json

{
    "event": "media.pause",
    "user": true,
    "owner": true,
    "Account": {
        "id": 4657934,
        "thumb": "https://plex.tv/users/df084946835de8f9/avatar?c=1642469099",
        "title": "*****************"
    },
    "Server": {
        "title": "Raspberry",
        "uuid": "*****************"
    },
    "Player": {
        "local": true,
        "publicAddress": "*****************",
        "title": "iPhone",
        "uuid": "*****************"
    },
    "Metadata": {
        "librarySectionType": "movie",
        "ratingKey": "9392",
        "key": "/library/metadata/9392",
        "guid": "com.plexapp.agents.themoviedb://163?lang=en",
        "studio": "Village Roadshow Pictures",
        "type": "movie",
        "title": "Ocean's Twelve",
        "librarySectionTitle": "Movies",
        "librarySectionID": 1,
        "librarySectionKey": "/library/sections/1",
        "contentRating": "PG-13",
        "summary": "Danny Ocean reunites with his old flame and the rest of his merry band of thieves in carrying out three huge heists in Rome, Paris and Amsterdam – but a Europol agent is hot on their heels.",
        "rating": 6.6,
        "viewOffset": 2537785,
        "viewCount": 1,
        "skipCount": 1,
        "lastViewedAt": 1666134732,
        "year": 2004,
        "tagline": "Twelve is the new eleven.",
        "thumb": "/library/metadata/9392/thumb/1646437675",
        "art": "/library/metadata/9392/art/1646437675",
        "duration": 7500000,
        "originallyAvailableAt": "2004-12-07",
        "addedAt": 1644116899,
        "updatedAt": 1646437675,
        "primaryExtraKey": "/library/metadata/9394",
        "Genre": [{
            "id": 15043,
            "filter": "genre=15043",
            "tag": "Thriller",
            "count": 99
        }, {
            "id": 6,
            "filter": "genre=6",
            "tag": "Crime",
            "count": 57
        }],
        "Director": [{
            "id": 28799,
            "filter": "director=28799",
            "tag": "Steven Soderbergh",
            "count": 3
        }],
        "Writer": [{
            "id": 28925,
            "filter": "writer=28925",
            "tag": "George Nolfi"
        }],
        "Producer": [{
            "id": 28867,
            "filter": "producer=28867",
            "tag": "Jerry Weintraub",
            "count": 3
        }],
        "Country": [{
            "id": 21793,
            "filter": "country=21793",
            "tag": "USA",
            "count": 315
        }],
        "Rating": [{
            "image": "imdb://image.rating",
            "value": 6.5,
            "type": "audience",
            "count": 436
        }, {
            "image": "rottentomatoes://image.rating.upright",
            "value": 6.0,
            "type": "audience",
            "count": 333
        }, {
            "image": "rottentomatoes://image.rating.rotten",
            "value": 5.5,
            "type": "critic",
            "count": 130
        }, {
            "image": "themoviedb://image.rating",
            "value": 6.6,
            "type": "audience",
            "count": 436
        }],
        "Collection": [{
            "id": 28868,
            "filter": "collection=28868",
            "tag": "Ocean's",
            "count": 3
        }],
        "Role": [{
            "id": 28805,
            "filter": "actor=28805",
            "tag": "George Clooney",
            "count": 3,
            "role": "Danny Ocean",
            "thumb": "http://image.tmdb.org/t/p/original/kHiVY6r1k6juXrNetAYk2jILqn9.jpg"
        }, {
            "id": 26510,
            "filter": "actor=26510",
            "tag": "Brad Pitt",
            "count": 5,
            "role": "Rusty Ryan",
            "thumb": "http://image.tmdb.org/t/p/original/oTB9vGIBacH5aQNS0pUM74QSWuf.jpg"
        }, {
            "id": 25097,
            "filter": "actor=25097",
            "tag": "Matt Damon",
            "count": 8,
            "role": "Linus Caldwell",
            "thumb": "http://image.tmdb.org/t/p/original/2goD0rteX2KxIpOpz3fBw9vtSdV.jpg"
        }, {
            "id": 28926,
            "filter": "actor=28926",
            "tag": "Catherine Zeta-Jones",
            "role": "Isabel Lahiri",
            "thumb": "http://image.tmdb.org/t/p/original/9VE0zNIs11aD9BHCKiGAZEIE5c8.jpg"
        }, {
            "id": 28807,
            "filter": "actor=28807",
            "tag": "Julia Roberts",
            "count": 2,
            "role": "Tess Ocean",
            "thumb": "http://image.tmdb.org/t/p/original/4XvEI2AgZ7bNOy1z2Nx8LcwLnTM.jpg"
        }, {
            "id": 28806,
            "filter": "actor=28806",
            "tag": "Andy García",
            "count": 4,
            "role": "Terry Benedict",
            "thumb": "http://image.tmdb.org/t/p/original/s9sFJ2TEVYBThRuLTz7GnAaLisV.jpg"
        }, {
            "id": 26625,
            "filter": "actor=26625",
            "tag": "Casey Affleck",
            "count": 4,
            "role": "Virgil Malloy",
            "thumb": "http://image.tmdb.org/t/p/original/fGo8nikBhtI0g3InpGc3WmLZXzi.jpg"
        }, {
            "id": 28810,
            "filter": "actor=28810",
            "tag": "Scott Caan",
            "count": 3,
            "role": "Turk Malloy",
            "thumb": "http://image.tmdb.org/t/p/original/67V8YrMglGzvuTOZGpqygDhNK1z.jpg"
        }, {
            "id": 28812,
            "filter": "actor=28812",
            "tag": "Shaobo Qin",
            "count": 3,
            "role": "\"The Amazing\" Yen",
            "thumb": "http://image.tmdb.org/t/p/original/jdAu5tXWwMtkusuQuHV7zlK457i.jpg"
        }, {
            "id": 27992,
            "filter": "actor=27992",
            "tag": "Bernie Mac",
            "count": 5,
            "role": "Frank Catton",
            "thumb": "http://image.tmdb.org/t/p/original/bwMmpeu3whjhhaxt1UTCk7S5jmv.jpg"
        }, {
            "id": 22885,
            "filter": "actor=22885",
            "tag": "Don Cheadle",
            "count": 8,
            "role": "Basher Tarr",
            "thumb": "http://image.tmdb.org/t/p/original/b1EVJWdFn7a75qVYJgwO87W2TJU.jpg"
        }, {
            "id": 28809,
            "filter": "actor=28809",
            "tag": "Carl Reiner",
            "count": 4,
            "role": "Saul Bloom",
            "thumb": "http://image.tmdb.org/t/p/original/mOTXz6LK7PUdqGcTVfQl7MtqCrV.jpg"
        }, {
            "id": 28811,
            "filter": "actor=28811",
            "tag": "Eddie Jemison",
            "count": 3,
            "role": "Livingston Dell",
            "thumb": "http://image.tmdb.org/t/p/original/tHj0nZbzewuK0D748luDf1ZI9In.jpg"
        }, {
            "id": 28808,
            "filter": "actor=28808",
            "tag": "Elliott Gould",
            "count": 3,
            "role": "Reuben Tishkoff",
            "thumb": "http://image.tmdb.org/t/p/original/ismZMvs8QxRR33OAVp9AKr3TokP.jpg"
        }, {
            "id": 23690,
            "filter": "actor=23690",
            "tag": "Robbie Coltrane",
            "count": 11,
            "role": "Matsui",
            "thumb": "http://image.tmdb.org/t/p/original/jOHs3xvlwRiiG2CLtso5zzmGCXg.jpg"
        }, {
            "id": 28872,
            "filter": "actor=28872",
            "tag": "Vincent Cassel",
            "count": 2,
            "role": "Baron François Toulour / Night Fox",
            "thumb": "http://image.tmdb.org/t/p/original/ykBEiVh6YQ9UmMAYUiQkZBH3VV4.jpg"
        }, {
            "id": 23828,
            "filter": "actor=23828",
            "tag": "Eddie Izzard",
            "count": 6,
            "role": "Roman Nagel",
            "thumb": "http://image.tmdb.org/t/p/original/nOSAx8YlR9w8fZDjfIehKrYvgmk.jpg"
        }, {
            "id": 28927,
            "filter": "actor=28927",
            "tag": "Albert Finney",
            "count": 2,
            "role": "Gaspar LeMarque (uncredited)",
            "thumb": "http://image.tmdb.org/t/p/original/2sERwXPq1EMoplrRgAs8DUmyzgF.jpg"
        }, {
            "id": 26628,
            "filter": "actor=26628",
            "tag": "Topher Grace",
            "count": 3,
            "role": "Topher Grace (uncredited)",
            "thumb": "http://image.tmdb.org/t/p/original/tgF5PeH4xwz32FjB80n5aFiuHX.jpg"
        }, {
            "id": 27732,
            "filter": "actor=27732",
            "tag": "Bruce Willis",
            "count": 2,
            "role": "Bruce Willis (uncredited)",
            "thumb": "http://image.tmdb.org/t/p/original/caX3KtMU42EP3VLRFFBwqIIrch5.jpg"
        }, {
            "id": 28928,
            "filter": "actor=28928",
            "tag": "Jared Harris",
            "count": 2,
            "role": "Basher's Engineer",
            "thumb": "http://image.tmdb.org/t/p/original/jAyPWkmge3BqXtgxIG9MfXBzOGj.jpg"
        }, {
            "id": 28929,
            "filter": "actor=28929",
            "tag": "Ed Kross",
            "role": "Bank Officer",
            "thumb": "http://image.tmdb.org/t/p/original/a1oYof1mFXIED2R5gIzKGE19lqs.jpg"
        }, {
            "id": 28930,
            "filter": "actor=28930",
            "tag": "Anne Jacques",
            "role": "Shop Owner",
            "thumb": "http://image.tmdb.org/t/p/original/114oAIgsoZrgIitUBsgs2ZsmBnI.jpg"
        }, {
            "id": 28817,
            "filter": "actor=28817",
            "tag": "David Sontag",
            "count": 2,
            "role": "Plainclothes Goon #1",
            "thumb": "http://image.tmdb.org/t/p/original/g4tErR4lJudD8hNTEw5jqmrp4Pe.jpg"
        }, {
            "id": 28818,
            "filter": "actor=28818",
            "tag": "Larry Sontag",
            "count": 2,
            "role": "Plainclothes Goon #2"
        }, {
            "id": 28931,
            "filter": "actor=28931",
            "tag": "Don Tiffany",
            "role": "House Painter",
            "thumb": "http://image.tmdb.org/t/p/original/7F2iFTepN9TuxSrizmMFTsCZzbA.jpg"
        }, {
            "id": 28932,
            "filter": "actor=28932",
            "tag": "Dina Connolly",
            "role": "Virgil's Fiancée"
        }, {
            "id": 28933,
            "filter": "actor=28933",
            "tag": "Nelson Peltz",
            "role": "Partygoer"
        }, {
            "id": 28934,
            "filter": "actor=28934",
            "tag": "Mini Anden",
            "role": "Supermodel",
            "thumb": "http://image.tmdb.org/t/p/original/rcj3F06hSX47Xui11KEfGSPuBgF.jpg"
        }, {
            "id": 28935,
            "filter": "actor=28935",
            "tag": "Jennifer Liu",
            "role": "Mani-pedi Woman #1"
        }, {
            "id": 28936,
            "filter": "actor=28936",
            "tag": "Leah Zhang",
            "role": "Mani-pedi Woman #2",
            "thumb": "http://image.tmdb.org/t/p/original/hN8xrmSWOokhUUSOy6th44RBY9z.jpg"
        }, {
            "id": 28937,
            "filter": "actor=28937",
            "tag": "Craig Susser",
            "role": "Men's Club Waiter",
            "thumb": "http://image.tmdb.org/t/p/original/g8tZmDgPG4HB52YULdw6xABilJQ.jpg"
        }, {
            "id": 28938,
            "filter": "actor=28938",
            "tag": "James Schneider",
            "role": "Club Heckler"
        }, {
            "id": 28939,
            "filter": "actor=28939",
            "tag": "Nerissa Tedesco",
            "role": "Palm Reader",
            "thumb": "http://image.tmdb.org/t/p/original/AdRMPw5z5msAiDqcJOGPmaBj7Vq.jpg"
        }, {
            "id": 28940,
            "filter": "actor=28940",
            "tag": "Nichelle Hines",
            "role": "Assistant Manager",
            "thumb": "http://image.tmdb.org/t/p/original/hrlcvzTFbaiF9haxViKcALCrTiV.jpg"
        }, {
            "id": 28941,
            "filter": "actor=28941",
            "tag": "Michael Van Der Heijden",
            "role": "Funeral Priest"
        }, {
            "id": 28942,
            "filter": "actor=28942",
            "tag": "Jeroen Krabbé",
            "role": "Van der Woude",
            "thumb": "http://image.tmdb.org/t/p/original/r26lZKUeLIaUt8DMotm4mdc4EaY.jpg"
        }, {
            "id": 28943,
            "filter": "actor=28943",
            "tag": "Johan Widerberg",
            "role": "Johan",
            "thumb": "http://image.tmdb.org/t/p/original/vzD8l02LjcF3AleiUNhtogOvHE9.jpg"
        }, {
            "id": 28944,
            "filter": "actor=28944",
            "tag": "Jeroen Willems",
            "role": "Paul",
            "thumb": "http://image.tmdb.org/t/p/original/tTgWJs2vJqvxjvT99e6wopLAttn.jpg"
        }, {
            "id": 28945,
            "filter": "actor=28945",
            "tag": "Chris Tates",
            "role": "Paul's Partner",
            "thumb": "http://image.tmdb.org/t/p/original/96RhxT8M6qmd90qMO8fNH4Vfo3m.jpg"
        }, {
            "id": 28813,
            "filter": "actor=28813",
            "tag": "Michael Delano",
            "count": 2,
            "role": "Casino Manager",
            "thumb": "http://image.tmdb.org/t/p/original/u59eH3f6QudIl5zuVzpet6TOcZZ.jpg"
        }, {
            "id": 28946,
            "filter": "actor=28946",
            "tag": "David Lindsay",
            "role": "Arsenal Bus Driver"
        }, {
            "id": 28947,
            "filter": "actor=28947",
            "tag": "Nasser Faris",
            "role": "Frank's Jail Mate",
            "thumb": "http://image.tmdb.org/t/p/original/i0zFVO7GjQqxiwrYljaQzhHKqjr.jpg"
        }, {
            "id": 28948,
            "filter": "actor=28948",
            "tag": "Candice Azzara",
            "count": 2,
            "role": "Saul's Lady",
            "thumb": "http://image.tmdb.org/t/p/original/4H5oacxmRVgqc2oGU9SmjRaOr1A.jpg"
        }, {
            "id": 27049,
            "filter": "actor=27049",
            "tag": "Youma Diakite",
            "count": 2,
            "role": "Toulour Woman #1",
            "thumb": "http://image.tmdb.org/t/p/original/xDvlOmg2GqpBeKRLoSQaeTJf7uD.jpg"
        }, {
            "id": 28949,
            "filter": "actor=28949",
            "tag": "Andrea Buhl",
            "role": "Toulour Woman #2"
        }, {
            "id": 28950,
            "filter": "actor=28950",
            "tag": "Sylvia Kwon",
            "role": "Toulour Woman #3"
        }, {
            "id": 28951,
            "filter": "actor=28951",
            "tag": "Francesca Lancini",
            "role": "Toulour Woman #4"
        }, {
            "id": 28952,
            "filter": "actor=28952",
            "tag": "Raquel Faria",
            "role": "Toulour Woman #5"
        }, {
            "id": 28953,
            "filter": "actor=28953",
            "tag": "Elena Potapova",
            "role": "Toulour Woman #6"
        }, {
            "id": 28954,
            "filter": "actor=28954",
            "tag": "Jessie Bell",
            "role": "Toulour Woman #7"
        }, {
            "id": 28955,
            "filter": "actor=28955",
            "tag": "Anne-Solenne Hatte",
            "role": "Toulour Woman #8",
            "thumb": "http://image.tmdb.org/t/p/original/oMgKC6wAuFhcWtnEG3rwl1NmhIF.jpg"
        }, {
            "id": 28956,
            "filter": "actor=28956",
            "tag": "Denny Méndez",
            "role": "Toulour Woman #9",
            "thumb": "http://image.tmdb.org/t/p/original/88Uec8lMotZv5xSacOFPDo1qEbv.jpg"
        }, {
            "id": 28823,
            "filter": "actor=28823",
            "tag": "Jerry Weintraub",
            "count": 3,
            "role": "American Businessman",
            "thumb": "http://image.tmdb.org/t/p/original/txf5fbZ1U61Iq3D89rB2HnD7cuj.jpg"
        }, {
            "id": 28957,
            "filter": "actor=28957",
            "tag": "Martina Stella",
            "role": "Nagel's Assistant",
            "thumb": "http://image.tmdb.org/t/p/original/2r14C4NgZDiQkeyKxDSevbNuDIC.jpg"
        }, {
            "id": 28958,
            "filter": "actor=28958",
            "tag": "Mattia Sbragia",
            "role": "Commissario Giordano",
            "thumb": "http://image.tmdb.org/t/p/original/uQYa5QiHBMLZ0nAtnWEDMUwrTZa.jpg"
        }, {
            "id": 28959,
            "filter": "actor=28959",
            "tag": "Carlo Antonazzo",
            "role": "Security Advisor"
        }, {
            "id": 28960,
            "filter": "actor=28960",
            "tag": "Mingming Gao",
            "role": "Chinese Mother"
        }, {
            "id": 28961,
            "filter": "actor=28961",
            "tag": "Amelie Kahn-Ackermann",
            "role": "Chinese Daughter"
        }, {
            "id": 28962,
            "filter": "actor=28962",
            "tag": "Luciano Miele",
            "role": "Hotel Manager",
            "thumb": "http://image.tmdb.org/t/p/original/kGH7SjZ18wdq0ERtRNgojLKGLyq.jpg"
        }, {
            "id": 28963,
            "filter": "actor=28963",
            "tag": "Antonio De Matteo",
            "role": "Hotel Employee",
            "thumb": "http://image.tmdb.org/t/p/original/aBr0LvEVVONzsUOoBB0rliqNLFf.jpg"
        }, {
            "id": 28964,
            "filter": "actor=28964",
            "tag": "Ana Caterina Morariu",
            "role": "Bruce Willis' Companion",
            "thumb": "http://image.tmdb.org/t/p/original/dmHvMO6j3aREHCdjlBiNPv54DQ9.jpg"
        }, {
            "id": 28965,
            "filter": "actor=28965",
            "tag": "Adriano Giannini",
            "role": "Museum Director",
            "thumb": "http://image.tmdb.org/t/p/original/kJiwMKAFUgHreid1ES0xrG8r5H0.jpg"
        }, {
            "id": 28966,
            "filter": "actor=28966",
            "tag": "Giulio Magnolia",
            "role": "Photographer"
        }, {
            "id": 28967,
            "filter": "actor=28967",
            "tag": "Marco Matronelli",
            "role": "Photographer's Assistant",
            "thumb": "http://image.tmdb.org/t/p/original/1fcVSbtKVxTNc0yDnQK4N2XvNIt.jpg"
        }, {
            "id": 28968,
            "filter": "actor=28968",
            "tag": "Cherry Jones",
            "role": "Molly Star / Mrs. Caldwell",
            "thumb": "http://image.tmdb.org/t/p/original/kXvzR2JFgTQhaUdMVZi23KXDB8c.jpg"
        }, {
            "id": 28814,
            "filter": "actor=28814",
            "tag": "Scott L. Schwartz",
            "count": 3,
            "role": "Bruiser",
            "thumb": "http://image.tmdb.org/t/p/original/osZ4griKNjwe7zSee2xcV89qBcU.jpg"
        }, {
            "id": 28969,
            "filter": "actor=28969",
            "tag": "Giselda Volodi",
            "role": "Toulour's Butler",
            "thumb": "http://image.tmdb.org/t/p/original/g3L1QiOln7NOOJcDuLNgDum23x9.jpg"
        }, {
            "id": 28970,
            "filter": "actor=28970",
            "tag": "Mathieu Simonet",
            "role": "Backpack Kid",
            "thumb": "http://image.tmdb.org/t/p/original/y5eim4dwWhM1CeaO7Ih7aVQdyXu.jpg"
        }, {
            "id": 28971,
            "filter": "actor=28971",
            "tag": "Karl A. Brown",
            "role": "Train Security #1"
        }, {
            "id": 28972,
            "filter": "actor=28972",
            "tag": "Marc Bodnar",
            "role": "Train Security #2",
            "thumb": "http://image.tmdb.org/t/p/original/sbHlSfbqFwask6JtSgxzv6jPFzM.jpg"
        }]
    }
}
-- -- -- -- -- -- -- -- -- -- -- -- --bdb1266bd886aac4--

Try this in a function node.

msg.payload = msg.payload.slice(
    msg.payload.indexOf("{"),
    msg.payload.lastIndexOf("}") + 1
    )
return msg;

Example flow with shortened payload string for testing

[{"id":"be1f1fbc9d72170b","type":"inject","z":"06afa4f2be886b2e","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":320,"y":300,"wires":[["8a34bde7b0fd2665"]]},{"id":"8a34bde7b0fd2665","type":"template","z":"06afa4f2be886b2e","name":"simulate webhook payload","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"-- -- -- -- -- -- -- -- -- -- -- -- --bdb1266bd886aac4\nContent - Disposition: form - data;\nname = \"payload\"\nContent - Type: application / json\n\n{\n    \"event\": \"media.pause\",\n    \"user\": true,\n    \"owner\": true\n    \n}\n-- -- -- -- -- -- -- -- -- -- -- -- --bdb1266bd886aac4--","output":"str","x":520,"y":300,"wires":[["549181516548fc09"]]},{"id":"549181516548fc09","type":"function","z":"06afa4f2be886b2e","name":"function 14","func":"msg.payload = msg.payload.slice(\n    msg.payload.indexOf(\"{\"),\n    msg.payload.lastIndexOf(\"}\") + 1\n    )\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":510,"y":360,"wires":[["90671cea274db923"]]},{"id":"90671cea274db923","type":"json","z":"06afa4f2be886b2e","name":"","property":"payload","action":"","pretty":false,"x":650,"y":360,"wires":[["83dfbceff9236cd0"]]},{"id":"83dfbceff9236cd0","type":"debug","z":"06afa4f2be886b2e","name":"debug 100","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":810,"y":360,"wires":[]}]

Pardon the intrusion, but one should wonder why you receive an usable payload, this is the whole point of a webhook. I would suggest to open an issue on github (assuming you are using the home assistant websocket) nodes.

You could also try to use the plex websocket node, directly in node-red, that will fire any event coming from plex.

Worked! Thank you @E1cid, life saver!

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.