Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't match MSG91 API (does it even work?) #23

Closed
Megamannen opened this issue Sep 15, 2023 · 8 comments
Closed

Doesn't match MSG91 API (does it even work?) #23

Megamannen opened this issue Sep 15, 2023 · 8 comments
Assignees

Comments

@Megamannen
Copy link

Megamannen commented Sep 15, 2023

The API wants these values (https://api.msg91.com/api/v5/flow/)

{ 
"template_id":"EntertemplateID", 
"short_url": "1 (On) or 0 (Off)",   
 "recipients" : [     {       "mobiles":"919XXXXXXXXX",       "VAR1": "VALUE1",       "VAR2": "VALUE2"         }   ] }

Not even close to what is actually sent

'flow_id' => $message->getFrom(),

@abnegate
Copy link
Member

@wess Please take a look here

@gaurav-chandra
Copy link

Yes, the api is not working at all and the api is changed completely https://docs.msg91.com/reference/sendotp

@abhishekjain12
Copy link

abhishekjain12 commented Oct 18, 2023

[notice] Starting work on (Job{v1-messaging} | ID: a6f36964b9d36ae00016e3090331ad7a | MessagingV1 | [{"project":null,"user":null,"payload":[],"recipient":"+91123456789","message":"388486","events":["."]}])
[critical] (Job{v1-messaging} | ID: a6f36964b9d36ae00016e3090331ad7a | MessagingV1 | [{"project":null,"user":null,"payload":[],"recipient":"+91123456789","message":"388486","events":["."]}]) has failed Error: Call to a member function send() on null in /usr/src/code/app/workers/messaging.php:69
Stack trace:
#0 /usr/src/code/src/Appwrite/Resque/Worker.php(125): MessagingV1->run()
#1 /usr/src/code/vendor/resque/php-resque/lib/Resque/Job.php(201): Appwrite\Resque\Worker->perform()
#2 /usr/src/code/vendor/resque/php-resque/lib/Resque/Worker.php(303): Resque_Job->perform()
#3 /usr/src/code/vendor/resque/php-resque/lib/Resque/Worker.php(242): Resque_Worker->perform(Object(Resque_Job))
#4 /usr/src/code/vendor/resque/php-resque/bin/resque(185): Resque_Worker->work('1', false)
#5 {main}```

@stnguyen90
Copy link
Contributor

The API wants these values (https://api.msg91.com/api/v5/flow/)

{ 
"template_id":"EntertemplateID", 
"short_url": "1 (On) or 0 (Off)",   
 "recipients" : [     {       "mobiles":"919XXXXXXXXX",       "VAR1": "VALUE1",       "VAR2": "VALUE2"         }   ] }

Not even close to what is actually sent

@Megamannen Where do you see this? Looking at the docs for the Flow API, the parameters seem correct.

Yes, the api is not working at all and the api is changed completely https://docs.msg91.com/reference/sendotp

@gaurav-chandra, as mentioned, Appwrite uses the FLOW API and not the Send OTP API.

@stnguyen90
Copy link
Contributor

[notice] Starting work on (Job{v1-messaging} | ID: a6f36964b9d36ae00016e3090331ad7a | MessagingV1 | [{"project":null,"user":null,"payload":[],"recipient":"+91123456789","message":"388486","events":["."]}])
[critical] (Job{v1-messaging} | ID: a6f36964b9d36ae00016e3090331ad7a | MessagingV1 | [{"project":null,"user":null,"payload":[],"recipient":"+91123456789","message":"388486","events":["."]}]) has failed Error: Call to a member function send() on null in /usr/src/code/app/workers/messaging.php:69
Stack trace:
#0 /usr/src/code/src/Appwrite/Resque/Worker.php(125): MessagingV1->run()
#1 /usr/src/code/vendor/resque/php-resque/lib/Resque/Job.php(201): Appwrite\Resque\Worker->perform()
#2 /usr/src/code/vendor/resque/php-resque/lib/Resque/Worker.php(303): Resque_Job->perform()
#3 /usr/src/code/vendor/resque/php-resque/lib/Resque/Worker.php(242): Resque_Worker->perform(Object(Resque_Job))
#4 /usr/src/code/vendor/resque/php-resque/bin/resque(185): Resque_Worker->work('1', false)
#5 {main}```

@abhishekjain12, would you please make sure msg91 is lowercase in the _APP_SMS_PROVIDER env var? If you're still having troubles, please create a support post on Discord.

@abhishekjain12
Copy link

[notice] Starting work on (Job{v1-messaging} | ID: a6f36964b9d36ae00016e3090331ad7a | MessagingV1 | [{"project":null,"user":null,"payload":[],"recipient":"+91123456789","message":"388486","events":["."]}])
[critical] (Job{v1-messaging} | ID: a6f36964b9d36ae00016e3090331ad7a | MessagingV1 | [{"project":null,"user":null,"payload":[],"recipient":"+91123456789","message":"388486","events":["."]}]) has failed Error: Call to a member function send() on null in /usr/src/code/app/workers/messaging.php:69
Stack trace:
#0 /usr/src/code/src/Appwrite/Resque/Worker.php(125): MessagingV1->run()
#1 /usr/src/code/vendor/resque/php-resque/lib/Resque/Job.php(201): Appwrite\Resque\Worker->perform()
#2 /usr/src/code/vendor/resque/php-resque/lib/Resque/Worker.php(303): Resque_Job->perform()
#3 /usr/src/code/vendor/resque/php-resque/lib/Resque/Worker.php(242): Resque_Worker->perform(Object(Resque_Job))
#4 /usr/src/code/vendor/resque/php-resque/bin/resque(185): Resque_Worker->work('1', false)
#5 {main}```

@abhishekjain12, would you please make sure msg91 is lowercase in the _APP_SMS_PROVIDER env var? If you're still having troubles, please create a support post on Discord.

@stnguyen90 Error is gone after making msg91, but still the OTP hasn't been sent. I will create a Discord post.

@gaurav-chandra
Copy link

@stnguyen90 I had a talk with msg91 people and they have told me that to send OTPs, we need to use the SEND OTP API as required by the telecom authority in India. The flow is used for promotional and transactional sms only. Transactional sms take some time to arrive compared to otps. Also, the flow api used in the adapter is deprecated and will be removed in their upcoming update as they have come out with a new API for flow.

@Megamannen
Copy link
Author

@Megamannen Where do you see this? Looking at the docs for the Flow API, the parameters seem correct.

https://docs.msg91.com/reference/send-sms
image

@stnguyen90 stnguyen90 linked a pull request Nov 8, 2023 that will close this issue
@stnguyen90 stnguyen90 moved this to Todo in 1.4 release Nov 8, 2023
@stnguyen90 stnguyen90 moved this from Todo to In Progress in 1.4 release Nov 8, 2023
@stnguyen90 stnguyen90 removed a link to a pull request Nov 8, 2023
@stnguyen90 stnguyen90 mentioned this issue Nov 9, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in 1.4 release Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants