氧化还原

HTTP状态码:它们的含义以及我们如何使用它们

发表于三月30,2017
朱莉娅·泽赫尔(Julia Zehel)

使用我们的API时,有时您可能会遇到HTTPS状态代码。由于状态码是我们API交流的重要方式,因此我们希望清楚地记录API可以返回哪些HTTP状态码,何时启动以及在遇到每个响应时应用程序应该做什么。我们还希望使用此页面来分享我们对webhooks的期望。

氧化还原API返回的响应代码

200响应表示已成功向Redox发送请求。

如果消息已发送到卫生系统且不需要响应,则仅表明数据模型有效且订阅已正确设置。

If the health system needs to respond, 200 will be sent along with relevant response data, which may include errors. For example, in ClinicalSummary Query, the health system may be down or there may be no documents available for the patient. This will be a 200 response with a Meta.Errors array.

{
  "Meta": {
    "Errors": [
      {
        "ID": 531806,
        "Text": "Something went wrong retrieving the document list. Please contact 氧化还原Support. Could not find any documents.",
        "Type": "query",
        "Module": "Send"
      }
    ]
  }
}

 

400错误的要求

400 Status code indicates that the message was received, but something was wrong with the request. Usually, this means that a required field is missing. For example, if the device message is missing Device.IDMeta.Errors will inform you of that.

{
  "Meta": {
    "DataModel": "Device",
    "EventType": "New",
    "Message": {
      "ID": 41962259
    },
    "Source": {
      "ID": "aed02b8f-f001-491d-a521-1d757af59bef",
      "Name": "redox-sample"
    },
    "Errors": [
      {
        "ID": 531829,
        "Text": "Required field missing - Device.ID in Device:New",
        "Type": "message",
        "Module": "DataModels"
      }
    ]
  }
}

 

401未经授权

氧化还原will return a 401 response when authentication to the 氧化还原API fails.

原因将以明文形式发送:

  • 无效的源机密
  • 此来源未经授权。
  • 找不到来源

 

$ curl \
-X POST //api.toyosteel.net.cn/auth/authenticate \
-H "Content-Type: application/json" \
-d '{"apiKey": "<API KEY>", "secret": "<SECRET>"}'
无效的源机密%

找不到404 /禁止403

氧化还原will return 403 and 404 responses if the API request does not use the POST verb, or if the /endpoint or /query are not used.

500内部服务器错误

氧化还原will return a 500 response when an unexpected error occurs in our system. Our automated pager will notify us instantly when this happens, but regardless, please reach out if you receive 上 e.

氧化还原如何处理应用程序中的响应代码

200 好

200 response from your application indicates that everything is 好. We wait for a 200 response before sending the next message. If we receive a 状态码 >= 400 we will pause before sending you any more transmissions and retry the last 上 e that failed.


引擎盖下

对于每个目的地,都有多个“subscription” queues. When get a response code >= 400 is received, the following happens:

含义

如果您对上面列出的任何信息有疑问,请不要’随时联系 [email protected]。我们’很高兴为您解决任何问题’在您的技术问题上拥有或提供额外的支持。