繁体   English   中英

如何从api网址获取json嵌套数据

[英]how to fetch json nested data from api url

这是我的json导出数据

{
"count":79,
"stories":{
  "23658975":{
     "title":"NOMINATIVO",
     "description":"BUSDRAGHI PIERGIORGIO",
     "updated_at":"2013-06-16T18:55:56+02:00",
     "created_at":"2013-06-16T18:39:06+02:00",
     "due_date":null,
     "start_date":null,
     "story_type":"task",
     "state":"not started",
     "position":14,
     "archived":false,
     "deleted_at":null,
     "sub_story_count":0,
     "budget_estimate_in_cents":null,
     "time_estimate_in_minutes":null,
     "budget_used_in_cents":0,
     "logged_billable_time_in_minutes":0,
     "id":"23658975",
     "workspace_id":"3190675",
     "parent_id":"23658965"
  },
  "23658985":{
     "title":"SOGGETTO",
     "description":"PRIVATO",
     "updated_at":"2013-06-16T18:55:56+02:00",
     "created_at":"2013-06-16T18:39:06+02:00",
     "due_date":null,
     "start_date":null,
     "story_type":"task",
     "state":"not started",
     "position":15,
     "archived":false,
     "deleted_at":null,
     "sub_story_count":0,
     "budget_estimate_in_cents":null,
     "time_estimate_in_minutes":null,
     "budget_used_in_cents":0,
     "logged_billable_time_in_minutes":0,
     "id":"23658985",
     "workspace_id":"3190675",
     "parent_id":"23658965"
  },
  "23658995":{
     "title":"CF/P.IVA",
     "description":"BSD PRG 77P19 G999C",
     "updated_at":"2013-06-16T18:55:56+02:00",
     "created_at":"2013-06-16T18:39:06+02:00",
     "due_date":null,
     "start_date":null,
     "story_type":"task",
     "state":"not started",
     "position":16,
     "archived":false,
     "deleted_at":null,
     "sub_story_count":0,
     "budget_estimate_in_cents":null,
     "time_estimate_in_minutes":null,
     "budget_used_in_cents":0,
     "logged_billable_time_in_minutes":0,
     "id":"23658995",
     "workspace_id":"3190675",
     "parent_id":"23658965"
  },
  "23659005":{
     "title":"DOMICILIO o SEDE LEGALE",
     "description":"Via NOMEVIA, xx - LOCALITA CAP COMUNE (PR)",
     "updated_at":"2013-06-16T18:55:56+02:00",
     "created_at":"2013-06-16T18:39:06+02:00",
     "due_date":null,
     "start_date":null,
     "story_type":"task",
     "state":"not started",
     "position":17,
     "archived":false,
     "deleted_at":null,
     "sub_story_count":0,
     "budget_estimate_in_cents":null,
     "time_estimate_in_minutes":null,
     "budget_used_in_cents":0,
     "logged_billable_time_in_minutes":0,
     "id":"23659005",
     "workspace_id":"3190675",
     "parent_id":"23658965"
  },
  "23659015":{
     "title":"LEGALE RAPPRESENTANTE",
     "description":"-",
     "updated_at":"2013-06-21T00:46:56+02:00",
     "created_at":"2013-06-16T18:39:06+02:00",
     "due_date":null,
     "start_date":null,
     "story_type":"task",
     "state":"not started",
     "position":18,
     "archived":false,
     "deleted_at":null,
     "sub_story_count":0,
     "budget_estimate_in_cents":null,
     "time_estimate_in_minutes":null,
     "budget_used_in_cents":0,
     "logged_billable_time_in_minutes":0,
     "id":"23659015",
     "workspace_id":"3190675",
     "parent_id":"23658965",
     "sub_story_ids":[

     ]
  },
  "23658885":{
     "title":"INCARICO N.",
     "description":"22999",
     "updated_at":"2013-06-16T18:47:50+02:00",
     "created_at":"2013-06-16T18:39:05+02:00",
     "due_date":null,
     "start_date":null,
     "story_type":"task",
     "state":"not started",
     "position":5,
     "archived":false,
     "deleted_at":null,
     "sub_story_count":0,
     "budget_estimate_in_cents":null,
     "time_estimate_in_minutes":null,
     "budget_used_in_cents":0,
     "logged_billable_time_in_minutes":0,
     "id":"23658885",
     "workspace_id":"3190675",
     "parent_id":"23658875"
  },
  "23658895":{
     "title":"DATA INCARICO",
     "description":"12 Giugno 2013",
     "updated_at":"2013-06-16T18:47:50+02:00",
     "created_at":"2013-06-16T18:39:05+02:00",
     "due_date":null,
     "start_date":null,
     "story_type":"task",
     "state":"not started",
     "position":6,
     "archived":false,
     "deleted_at":null,
     "sub_story_count":0,
     "budget_estimate_in_cents":null,
     "time_estimate_in_minutes":null,
     "budget_used_in_cents":0,
     "logged_billable_time_in_minutes":0,
     "id":"23658895",
     "workspace_id":"3190675",
     "parent_id":"23658875"
  },
  "23658905":{
     "title":"NUMERO SINISTRO",
     "description":"721234567-1",
     "updated_at":"2013-06-16T18:47:50+02:00",
     "created_at":"2013-06-16T18:39:05+02:00",
     "due_date":null,
     "start_date":null,
     "story_type":"task",
     "state":"not started",
     "position":7,
     "archived":false,
     "deleted_at":null,
     "sub_story_count":0,
     "budget_estimate_in_cents":null,
     "time_estimate_in_minutes":null,
     "budget_used_in_cents":0,
     "logged_billable_time_in_minutes":0,
     "id":"23658905",
     "workspace_id":"3190675",
     "parent_id":"23658875"
  },
  "23658915":{
     "title":"DATA SINISTRO",
     "description":"1/5/13",
     "updated_at":"2013-06-16T18:47:50+02:00",
     "created_at":"2013-06-16T18:39:05+02:00",
     "due_date":null,
     "start_date":null,
     "story_type":"task",
     "state":"not started",
     "position":8,
     "archived":false,
     "deleted_at":null,
     "sub_story_count":0,
     "budget_estimate_in_cents":null,
     "time_estimate_in_minutes":null,
     "budget_used_in_cents":0,
     "logged_billable_time_in_minutes":0,
     "id":"23658915",
     "workspace_id":"3190675",
     "parent_id":"23658875"
  }, ... and so on ... (check the api url blow for full file)

导出文件是通过API网址自动生成的,因此我无法修改json结构。 这是完整的json文件http://www.studiokaleya.it/mavenlinkapi/dati/stories.json

这是我想做的事情:

  1. 一个网页,其中包含用于api url,workspace_id值和按钮的可填充字段,用于自动在api上生成搜索
  2. 从json中获取数据并报告html表中的“标题”和报告“描述”值

暂存表示例:

<TABLE>
<TR>
<TD>NUMERO SINISTRO</TD>
<TD>DATA SINISTRO</TD>
<TD>MORE DATA>
</TR>
<TR>
<TD>here goes "description" value for "NUMERO SINISTRO"</TD>
<TD>here goes "description" value for "DATA SINISTRO"</TD>
<TD>and so on...</TD></TR>
</TABLE>

有点超出我的能力范围了...所以任何具体提示可能会有所帮助。

阅读此页面,然后了解您的进展情况。 特别是“从外部文件读取JSON”部分

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM