vba JSON调用没有返回相同的值

时间:2018-03-02 07:47:38

标签: json excel vba get request

我正在尝试通过vba从API调用获得响应。但我没有得到相同的字符串。我是API的新手,我不确定它出了什么问题。以下是我获取HTML响应的方法:

    myurl = Constants.BACKLOG_SITE & "/api/v2/issues?apiKey=" & APIkey
    xmlhttp.Open "GET", myurl, False
    xmlhttp.setRequestHeader "Content-type", "application/json"
    xmlhttp.setRequestHeader "Accept", "application/json"
    xmlhttp.send
    rURL = xmlhttp.responseText

这是回归:

[
   {
      "id":4883687,
      "projectId":80977,
      "issueKey":"EXCEL_TOOL_DEV-7",
      "keyId":7,
      "issueType":{
         "id":374448,
         "projectId":80977,
         "name":"タスク",
         "color":"#7ea800",
         "displayOrder":0
      },
      "summary":"TASK4",
      "description":"TASK4",
      "resolution":null,
      "priority":{
         "id":3,
         "name":"中"
      },
      "status":{
         "id":1,
         "name":"未対応"
      },
      "assignee":{
         "id":95981,
         "userId":null,
         "name":"辻本",
         "roleType":1,
         "lang":null,
         "mailAddress":null,
         "nulabAccount":null
      },
      "category":[

      ],
      "versions":[

      ],
      "milestone":[

      ],
      "startDate":"2018-02-28T00:00:00Z",
      "dueDate":"2018-04-15T00:00:00Z",
      "estimatedHours":null,
      "actualHours":null,
      "parentIssueId":null,
      "createdUser":{
         "id":183845,
         "userId":"brethren-i",
         "name":"Brethren",
         "roleType":2,
         "lang":"en",
         "mailAddress":"brethren-i@t-axis.co.jp",
         "nulabAccount":null
      },
      "created":"2018-03-02T06:48:13Z",
      "updatedUser":{
         "id":183845,
         "userId":"brethren-i",
         "name":"Brethren",
         "roleType":2,
         "lang":"en",
         "mailAddress":"brethren-i@t-axis.co.jp",
         "nulabAccount":null
      },
      "updated":"2018-03-02T06:48:13Z",
      "customFields":[

      ],
      "attachments":[

      ],
      "sharedFiles":[

      ],
      "stars":[

      ]
   }
] 

但是当我访问请求站点时,它返回两个值。哪个应该是正确的。我错过了什么?

[
   {
      "id":4883687,
      "projectId":80977,
      "issueKey":"EXCEL_TOOL_DEV-7",
      "keyId":7,
      "issueType":{
         "id":374448,
         "projectId":80977,
         "name":"タスク",
         "color":"#7ea800",
         "displayOrder":0
      },
      "summary":"TASK4",
      "description":"TASK4",
      "resolution":null,
      "priority":{
         "id":3,
         "name":"中"
      },
      "status":{
         "id":1,
         "name":"未対応"
      },
      "assignee":{
         "id":95981,
         "userId":null,
         "name":"辻本",
         "roleType":1,
         "lang":null,
         "mailAddress":null,
         "nulabAccount":null
      },
      "category":[

      ],
      "versions":[

      ],
      "milestone":[

      ],
      "startDate":"2018-02-28T00:00:00Z",
      "dueDate":"2018-04-15T00:00:00Z",
      "estimatedHours":null,
      "actualHours":null,
      "parentIssueId":null,
      "createdUser":{
         "id":183845,
         "userId":"brethren-i",
         "name":"Brethren",
         "roleType":2,
         "lang":"en",
         "mailAddress":"brethren-i@t-axis.co.jp",
         "nulabAccount":null
      },
      "created":"2018-03-02T06:48:13Z",
      "updatedUser":{
         "id":183845,
         "userId":"brethren-i",
         "name":"Brethren",
         "roleType":2,
         "lang":"en",
         "mailAddress":"brethren-i@t-axis.co.jp",
         "nulabAccount":null
      },
      "updated":"2018-03-02T06:48:13Z",
      "customFields":[

      ],
      "attachments":[

      ],
      "sharedFiles":[

      ],
      "stars":[

      ]
   },
   {
      "id":4883450,
      "projectId":80977,
      "issueKey":"EXCEL_TOOL_DEV-6",
      "keyId":6,
      "issueType":{
         "id":374448,
         "projectId":80977,
         "name":"タスク",
         "color":"#7ea800",
         "displayOrder":0
      },
      "summary":"TASK3",
      "description":"TASK3",
      "resolution":null,
      "priority":{
         "id":2,
         "name":"高"
      },
      "status":{
         "id":1,
         "name":"未対応"
      },
      "assignee":{
         "id":95981,
         "userId":null,
         "name":"辻本",
         "roleType":1,
         "lang":null,
         "mailAddress":null,
         "nulabAccount":null
      },
      "category":[

      ],
      "versions":[

      ],
      "milestone":[

      ],
      "startDate":"2018-02-28T00:00:00Z",
      "dueDate":"2018-04-15T00:00:00Z",
      "estimatedHours":null,
      "actualHours":null,
      "parentIssueId":null,
      "createdUser":{
         "id":183845,
         "userId":"brethren-i",
         "name":"Brethren",
         "roleType":2,
         "lang":"en",
         "mailAddress":"brethren-i@t-axis.co.jp",
         "nulabAccount":null
      },
      "created":"2018-03-02T06:35:35Z",
      "updatedUser":{
         "id":183845,
         "userId":"brethren-i",
         "name":"Brethren",
         "roleType":2,
         "lang":"en",
         "mailAddress":"brethren-i@t-axis.co.jp",
         "nulabAccount":null
      },
      "updated":"2018-03-02T06:45:28Z",
      "customFields":[

      ],
      "attachments":[

      ],
      "sharedFiles":[

      ],
      "stars":[

      ]
   }
] 

0 个答案:

没有答案