Required correct JSON format
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2025 05:26 AM
Below is the JSON format that i am using in rest API explorer, but i have doubt that this is not correct JSON format, please check is there is any mistake and help me.
{
"records":
[
{
"from_date":"20191017T010000",
"to_date":"20191018T030000"
}
]
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2025 05:32 AM
it's a valid JSON, it's an array of json object and has only 1 object in it which has those 2 dates
the API which you are testing should accept it
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2025 05:40 AM
Do you think i should add somthing next to the "record" , i mean the sys if and then only it will give me the correct data
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2025 05:42 AM
well it all depends on what API accepts.
Please check with the person who developed that API if it's a scripted REST API
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2025 05:44 AM
That's valid JSON format. You can always validate any json data with online validator like JSON Lint.
What makes you think this is not correct JSON format? You can share detailed use case where you are going to use this JSON so that we can help you further to build your confidence that this JSON would work for your use case.
Regards,
Abhijit
ServiceNow MVP