PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, May 19, 2022

[FIXED] What is your suggestion for defining this VOIP web-service?

 May 19, 2022     architecture, naming, routes, voip, web-services     No comments   

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)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing