I
I
iOS Dav2017-06-04 07:06:10
PHP
iOS Dav, 2017-06-04 07:06:10

How do you, experienced people, act in such cases?

This page has api https://turbosms.ua/soap.html There methods return texts. For example, the getStatus method returns the texts "message sent", "failed to send", etc.
The question is how to check the results of message delivery in php? $res = getStatus();
if ($res=='message sent') {...
So?
Or if (substr(... ???
What do you do in such cases when api does not return response codes, but returns texts?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
egor_nullptr, 2017-06-04
@egor_nullptr

What do you do in such cases when api does not return response codes, but returns texts?

We take another API.

D
Denis, 2017-06-04
@denis6064

especially for such cases in the database, in the status table there should be an additional field that corresponds to the English status with the code of your status cf (for example, sent = sent, etc. if it consists of two words, then the code should be separated by an underscore) . making the status this way will be much easier than checking the Russian text.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question