Issue
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
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.
Answered By - Masoud Shariati Answer Checked By - Terry (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.