简体   繁体   中英

Rest API batch response status

Suppose there is POST /inteview/:id/invite route. Parameters are email addresses:

{ 'emails': ['foo@test.com', 'bar@test.com'] }

Response should indicate that some addresses are successfully invited some not. For example:

  [ {
      "email": "foo@test.com",
      "status": "already invited"
    },
    {
      "email": "foo@test.com",
      "status": "already invited"
    }
  ]

Which status to return for partial success?

The Response's HTTP Status Code should be 200 OK , since you are getting the expected server's response.

Whether an email is invited or not, is not an actual error.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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