Hi Alex,
The json returned is not simple one. It has nested data. So you need to create class and read the json to class object.
Please refer below sample. with below code you can bind your GridView or something else.
JSON
[
{
"id": 437413,
"summary": "RE: FW: YOUR WEBSITE NEEDS TO BE SECURE NOW",
"recordType": "ServiceTicket",
"board": {
"id": 43,
"name": "zzHelpdesk",
"_info": { "board_href": "https://cw.forza.com/v4_6_release/apis/3.0/service/boards/43" }
},
"status": {
"id": 711,
"name": "Scheduled Remote~",
"_info": { "status_href": "https://cw.forza.com/v4_6_release/apis/3.0/service/boards/43/statuses/711" }
},
"workRole": {
"id": 11,
"name": "System Engineer",
"_info": { "workRole_href": "https://cw.forza.com/v4_6_release/apis/3.0/time/workRoles/11" }
},
"workType": {
"id": 18,
"name": "Remote"
}
}
]
Namespaces
C#
using System.IO;
using Newtonsoft.Json;
VB.Net
Imports System.IO
Imports Newtonsoft.json
Code
C#
protected void Page_Load(object sender, EventArgs e)
{
string json = File.ReadAllText(Server.MapPath("json.json"));
Root[] data = JsonConvert.DeserializeObject<Root[]>(json);
}
public class Info
{
public string board_href { get; set; }
public string status_href { get; set; }
public string workRole_href { get; set; }
}
public class Board
{
public int id { get; set; }
public string name { get; set; }
public Info _info { get; set; }
}
public class Status
{
public int id { get; set; }
public string name { get; set; }
public Info _info { get; set; }
}
public class WorkRole
{
public int id { get; set; }
public string name { get; set; }
public Info _info { get; set; }
}
public class WorkType
{
public int id { get; set; }
public string name { get; set; }
}
public class Root
{
public int id { get; set; }
public string summary { get; set; }
public string recordType { get; set; }
public Board board { get; set; }
public Status status { get; set; }
public WorkRole workRole { get; set; }
public WorkType workType { get; set; }
}
VB.Net
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
Dim json As String = File.ReadAllText(Server.MapPath("json.json"))
Dim data As Root() = JsonConvert.DeserializeObject(Of Root())(json)
End Sub
Public Class Info
Public Property board_href As String
Public Property status_href As String
Public Property workRole_href As String
End Class
Public Class Board
Public Property id As Integer
Public Property name As String
Public Property _info As Info
End Class
Public Class Status
Public Property id As Integer
Public Property name As String
Public Property _info As Info
End Class
Public Class WorkRole
Public Property id As Integer
Public Property name As String
Public Property _info As Info
End Class
Public Class WorkType
Public Property id As Integer
Public Property name As String
End Class
Public Class Root
Public Property id As Integer
Public Property summary As String
Public Property recordType As String
Public Property board As Board
Public Property status As Status
Public Property workRole As WorkRole
Public Property workType As WorkType
End Class
Screenshot