"invalid json payload received" error

{
“error”: {
“code”: 400,
“message”: “Invalid JSON payload received. Unknown name "": Root element must be a message.”,
“errors”: [
{
“message”: “Invalid JSON payload received. Unknown name "": Root element must be a message.”,
“reason”: “invalid”
}
],
“status”: “INVALID_ARGUMENT”,
“details”: [
{
@type”: “type.googleapis.com/google.rpc.BadRequest”,
“fieldViolations”: [
{
“description”: “Invalid JSON payload received. Unknown name "": Root element must be a message.”
}
]
}
]
}
}

Please how do I fix this error.

here’s my scenario

output:

[
{
“statusCode”: 400,
“headers”: [
{
“name”: “vary”,
“value”: “X-Origin, Referer, Origin,Accept-Encoding”
},
{
“name”: “content-type”,
“value”: “application/json; charset=UTF-8”
},
{
“name”: “date”,
“value”: “Tue, 07 May 2024 20:22:36 GMT”
},
{
“name”: “server”,
“value”: “scaffolding on HTTPServer2”
},
{
“name”: “cache-control”,
“value”: “private”
},
{
“name”: “x-xss-protection”,
“value”: “0”
},
{
“name”: “x-frame-options”,
“value”: “SAMEORIGIN”
},
{
“name”: “x-content-type-options”,
“value”: “nosniff”
},
{
“name”: “accept-ranges”,
“value”: “none”
},
{
“name”: “transfer-encoding”,
“value”: “chunked”
},
{
“name”: “alt-svc”,
“value”: “h3=":443"; ma=2592000,h3-29=":443"; ma=2592000”
},
{
“name”: “connection”,
“value”: “close”
}
],
“cookieHeaders”: ,
“data”: “{\n "error": {\n "code": 400,\n "message": "Invalid JSON payload received. Unknown name \"\": Root element must be a message.",\n "errors": [\n {\n "message": "Invalid JSON payload received. Unknown name \"\": Root element must be a message.",\n "reason": "invalid"\n }\n ],\n "status": "INVALID_ARGUMENT",\n "details": [\n {\n "@type": "type.googleapis.com/google.rpc.BadRequest",\n "fieldViolations": [\n {\n "description": "Invalid JSON payload received. Unknown name \"\": Root element must be a message."\n }\n ]\n }\n ]\n }\n}\n”,
“fileSize”: 618
}
]

input:

[
{
“ca”: null,
“qs”: [
{
“name”: “part”,
“value”: “snippet”
}
],
“url”: “https://www.googleapis.com/youtube/v3/videos?”,
“data”: “"{\n \"id\": bmQls6zbKiQ\",\n \"snippet\": {\n \"title\"my video test\",\n \"description\": \"Embrace the rhythm of life with every step copy copy copy copy copy copy copy copy copy\",\n \"categoryId\": \"24\",\n \"tags\": [\"travel\", \"vlog\", \"beach\"]\n }\n}"”,
“gzip”: true,
“method”: “put”,
“headers”: [
{
“name”: “Authorization”,
“value”: “Bearer ya29.a0AXooCgu8ata-Hkn4gZ1oH4mrIVo9_mm-cy0qEVRMRzEdpakkfDyTx6Dv2BGcB0dcUlJ9t_k4dGkNfUgNc8YhowzmA4s_pYqCy017LBksl8ZMdob5ZSsP8t1Aj8ed0pxMOEMS76EYqHle4zOQ3D_RtRCey-WX4JB5GWBybgaCgYKAeoSARMSFQHGX2MioBsn_n_tEZt15ebidpVHIA0173”
}
],
“timeout”: null,
“useMtls”: false,
“authPass”: null,
“authUser”: null,
“bodyType”: “raw”,
“contentType”: “application/json”,
“serializeUrl”: false,
“shareCookies”: false,
“parseResponse”: false,
“followRedirect”: true,
“useQuerystring”: false,
“followAllRedirects”: false,
“rejectUnauthorized”: true
}
]

Welcome to the Make community!

1. This forum might have or already changed your text

When pasting text into this forum, you should format the example text using the rich-text editor, otherwise the forum software might modify the displayed text, and you might get incorrect answers from others because of it.

Some things this forum software might do to mangle your text:

– remove extra spaces (which may be necessary)
– convert links to titles (when copied is incorrect)
– incorrect joined links
– convert single and double quotes to smart angled quotes ()
– emojis
– etc.

This interferes with you receiving correct answers, because it:

– makes JSON invalid (you can verify when copy-paste into https://jsonformatter.org)
– makes incorrect text examples when we need to build a pattern for text parsing

2. To prevent this in future, please format text in code blocks

A. Type code fence manually
Either add three backticks ``` before and after the text, like this:

```
content goes here
```

B. Highlight and click the format button
Or use the format code button in the editor:
Screenshot_2023-10-02_191027

3. You might need to re-copy the original text

Once the post has been submitted, it’s too late to format it since it’s already butchered, and you need to make a re-copy of the text, and format it before submitting the forum post.

Please let us know once you have corrected the issue. This will avoid others potentially providing wrong answers based on incorrect text in your question.

samliewrequest private consultation

Join the unofficial Make Discord server to chat with other makers!

1 Like

HI @Ifeoluwa_Ajiboye1

You can use json validator to check your input json and fix that. This is free https://jsonformatter.curiousconcept.com/# . to parse this JSON, you need to use parse JSON module.

If you require additional assistance, please don’t hesitate to reach out to us.
MSquare Support | Book Live Implementation
Visit us here
Youtube Channel

1 Like