I have been able to go through and generate an api key.
This is the response i get for the JavaScript code.
Please how can i display the results in a table with columns below
offices Name | officials Name | officials Phones | officials Email
{
"normalizedInput": {
"line1": "",
"city": "",
"state": "TX",
"zip": ""
},
"kind": "civicinfo#representativeInfoResponse",
"divisions": {
"ocd-division/country:us": {
"name": "United States",
"officeIndices": [ 0, 1 ]
},
"ocd-division/country:us/state:tx": {
"name": "Texas",
"officeIndices": [ 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ]
}
},
"offices": [
{
"name": "President of the United States",
"divisionId": "ocd-division/country:us",
"levels": [ "country" ],
"roles": [ "headOfGovernment", "headOfState" ],
"officialIndices": [ 0 ]
}
],
"officials": [
{
"name": "Joseph R. Biden",
"address": [
{
"line1": "1600 Pennsylvania Avenue Northwest",
"city": "Washington",
"state": "DC",
"zip": "20500"
}
],
"party": "Democratic Party",
"phones": [ "(202) 456-1111" ],
"urls": [ "https://www.whitehouse.gov/", "https://en.wikipedia.org/wiki/Joe_Biden" ],
"channels": [
{
"type": "Twitter",
"id": "potus"
}
],
"geocodingSummaries": [
{
"queryString": "The White House 1600 Pennsylvania Avenue NW Washington, DC 20500",
"featureId": {
"cellId": "9923602325795527449",
"fprint": "11513381022022344111"
},
"featureType": "typeCompoundBuilding",
"positionPrecisionMeters": 126.14545494347092,
"addressUnderstood": true
}
]
},
{
"name": "Kamala D. Harris",
"address": [
{
"line1": "1600 Pennsylvania Avenue Northwest",
"city": "Washington",
"state": "DC",
"zip": "20500"
}
],
"party": "Democratic Party",
"phones": [ "(202) 456-1111" ],
"urls": [ "https://www.whitehouse.gov/", "https://en.wikipedia.org/wiki/Kamala_Harris" ],
"channels": [
{
"type": "Twitter",
"id": "VP"
}
],
"geocodingSummaries": [
{
"queryString": "The White House 1600 Pennsylvania Avenue NW Washington, DC 20500",
"featureId": {
"cellId": "9923602325795527449",
"fprint": "11513381022022344111"
},
"featureType": "typeCompoundBuilding",
"positionPrecisionMeters": 126.14545494347092,
"addressUnderstood": true
}
]
},
{
"name": "John Cornyn",
"address": [
{
"line1": "517",
"line2": "120 Constitution Avenue Northeast",
"city": "Washington",
"state": "DC",
"zip": "20510"
}
],
"party": "Republican Party",
"phones": [ "(202) 224-2934" ],
"urls": [ "https://www.cornyn.senate.gov/", "https://en.wikipedia.org/wiki/John_Cornyn" ],
"photoUrl": "http://bioguide.congress.gov/bioguide/photo/C/C001056.jpg",
"channels": [
{
"type": "Facebook",
"id": "SenJohnCornyn"
},
{
"type": "Twitter",
"id": "JohnCornyn"
}
],
"geocodingSummaries": [
{
"queryString": "517 Hart Senate Office Building, 120 Constitution Ave NE, Washington DC 20510",
"featureId": {
"cellId": "9923602788763978871",
"fprint": "2526607997683318429"
},
"featureType": "typeGeocodedAddress",
"positionPrecisionMeters": 0,
"addressUnderstood": false
}
]
},
{
"name": "Ted Cruz",
"address": [
{
"line1": "127A",
"line2": "2 Constitution Avenue Northeast",
"city": "Washington",
"state": "DC",
"zip": "20510"
}
],
"party": "Republican Party",
"phones": [ "(202) 224-5922" ],
"urls": [ "https://www.cruz.senate.gov/", "https://en.wikipedia.org/wiki/Ted_Cruz" ],
"photoUrl": "http://www.cruz.senate.gov/files/images/OfficialPortrait.jpg",
"channels": [
{
"type": "Facebook",
"id": "SenatorTedCruz"
},
{
"type": "Twitter",
"id": "SenTedCruz"
}
],
"geocodingSummaries": [
{
"queryString": "127A Russell Senate Office Building, 2 Constitution Ave NE, Washington DC 20510",
"featureId": {
"cellId": "9923602777983093035",
"fprint": "16754435804240149550"
},
"featureType": "typeCompoundBuilding",
"positionPrecisionMeters": 154.99767133790925,
"addressUnderstood": false
}
]
},
{
"name": "Greg Abbott",
"address": [
{
"line1": "Office of the Governor",
"line2": "P.O. Box 12428",
"line3": "",
"city": "Austin",
"state": "TX",
"zip": "78711-2428"
}
],
"party": "Republican Party",
"phones": [ "(512) 463-2000" ],
"urls": [ "https://gov.texas.gov/", "https://en.wikipedia.org/wiki/Greg_Abbott" ],
"photoUrl": "http://gov.texas.gov/multimedia/photos/2015-GovernorAbbott-Portrait.jpg",
"channels": [
{
"type": "Facebook",
"id": "TexasGovernor"
},
{
"type": "Twitter",
"id": "GovAbbott"
}
],
"geocodingSummaries": [
{
"queryString": "P.O. Box 12428, Austin, TX 78711",
"featureId": {
"cellId": "9675056946379223897",
"fprint": "3655059361107894826"
},
"featureType": "typePostalCode",
"positionPrecisionMeters": 118.08594678413696,
"addressUnderstood": true
}
]
},
{
"name": "Dan Patrick",
"address": [
{
"line1": "Lieutenant Governor's Office",
"line2": "P.O. Box 12068",
"line3": "",
"city": "Austin",
"state": "TX",
"zip": "78711"
}
],
"party": "Republican Party",
"phones": [ "(512) 463-0001" ],
"urls": [ "https://www.ltgov.texas.gov/", "https://en.wikipedia.org/wiki/Dan_Patrick_%28politician%29" ],
"photoUrl": "https://www.ltgov.state.tx.us/wp-content/uploads/2015/02/dan_patrick.jpg",
"emails": [ "LTGConstituent.Affairs@ltgov.texas.gov" ],
"channels": [
{
"type": "Facebook",
"id": "ltgovtx"
},
{
"type": "Twitter",
"id": "LtGovTX"
}
],
"geocodingSummaries": [
{
"queryString": "P.O. Box 12068, Austin, TX 78711",
"featureId": {
"cellId": "9675056946379223897",
"fprint": "3655059361107894826"
},
"featureType": "typePostalCode",
"positionPrecisionMeters": 118.08594678413696,
"addressUnderstood": true
}
]
}
]
}
Thank you dharmendr