'What is your suggestion for defining this VOIP web-service?
What is your suggestion about defining routes for such a web-service?
Input:
called number
call date
Output:
caller number
call datetime
call duration
call status
It is the first request for a web-service on a complete VOIP system database (including CDR, forwarding policies, ...) to deliver services to external and internal applications.
So, my question is how to design further extendable web-service routes according to best practices? For example:
/getCalls?calledNumber=&callDate=
or
/get/calls/to/{calledNumber}/{callDate}
Solution 1:[1]
I implemented it this way:
GET https://voip-api-server/calls?called-number=&call-date=
The operation name (here: get) should not appear in the URI. All VOIP read requests should use GET method.
It can be extended further by adding more filter parameters such as fromDate, toDate, callerNumber, ... .
All CDR requests (and other call related services) reside in /calls.
I avoided multi-word names like calledNumber using dash characters in the URI.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 |