내 API에 RPC 스타일 동사가 표시되는 데 문제가 있습니다.RESTFUL (하이퍼 미디어) API의 동사
내 질문은 : Restful API에서 "Submit", "SendForApproval", "Accept"및 "Reject"동사를 사용해도 괜찮습니까? 그것은 안정된 원칙에 반하는 것입니까? 이러한 작업의 이름을 지정하는 가장 좋은 방법은 무엇입니까?
비즈니스 사례 : 주문이 있습니다. 그것은 "pre-ordered"상태에서 시작합니다. 그런 다음 비즈니스 로직에 대한 주문의 유효성을 확인하는 전화를 걸고 싶습니다. 검증 결과에 따라 제출하거나 승인을 위해 보내십시오. 승인 프로세스는 외부 적으로 Google 솔루션에서 발생하며 승인 프로세스를 거쳤을 때 Accept 또는 Rejected로 주문을 표시하기 위해 Api가 호출됩니다.
은 좀 더 간단하게 업데이트 상태보다가 벌어지고 - 우리는 등 문서 그래서 URI의 우리가 정의했다고
이다 내가 '
https://api.site.com/orders // A list of orders
https://api.site.com/orders/{orderId} // An order
https://api.site.com/orders/{orderId}/ValidationErrors // Get a list of validation results
https://api.site.com/orders/{orderId}/Submit // Submit the order for processing
https://api.site.com/orders/{orderId}/SendForApproval // Send to supervisor
https://api.site.com/orders/{orderId}/Accept // Supervisor Accepts the order for processing
https://api.site.com/orders/{orderId}/Reject // Supervisor can Reject the order