Dynamic SMS API integration php

793 Views Asked by At

I have made php system . in this system user must set his sms api information and system will automatically send sms to his clients

my problem is that there are many sms api and every api need different info for example(clickatell api need apiKey to be joined with url, receiver phone number ) but the another api need another information (username, password,to, from )

how can I allow user to integrate his sms api dynamically

1

There are 1 best solutions below

0
On

I do not know much about your system but generally speaking, in such situations where you have to deal with different forms of such external configuration, I can suggest a pattern.

There will always be a parameter called the $apiType of the SMS API: So you let the user select one of those first. Based on this selection, you ask for the values for selected API.

And of course, when your system needs to support more APIs, you add that to the list of possible values for the $apiType parameter along with corresponding fields.

Hope that works out for you.