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

D7networks SMS provider doesn't work #784

Closed
dokime7 opened this issue Dec 13, 2022 · 8 comments
Closed

D7networks SMS provider doesn't work #784

dokime7 opened this issue Dec 13, 2022 · 8 comments
Labels

Comments

@dokime7
Copy link
Contributor

dokime7 commented Dec 13, 2022

📣 Notification Service(s) Impacted
D7 Networks

🐞 Describe the bug
When called we receive HTTP 500

💻 Your System Details:

  • OS: Ubuntu 22.04.1
  • Python Version: Python 3.10.8
  • Docker image: v1.2.0

🔮 Additional context
D7 Networks has published a new API
I think that new accounts can't use the old API.
So, it's needed to update this service to add their new API

@dokime7 dokime7 added the bug label Dec 13, 2022
@caronc
Copy link
Owner

caronc commented Dec 15, 2022

Wow,

Thanks for sharing this; they completely re-designed their API. The new adaptation will be essentially a brand new plugin.

Do you know if the old API calls even work? Should i keep it backwards compatible to just replace the underlining library complete with the new. I can't see anywhere on their website where they even identify the old setup.

Thoughts?

@dokime7
Copy link
Contributor Author

dokime7 commented Dec 15, 2022

I don't know...
The old API doesn't work for me, maybe because my account has been created recently but I don't know if the old API is always working for old accounts...

Are you kept your d7 networks account for checking that?

@dokime7
Copy link
Contributor Author

dokime7 commented Dec 15, 2022

Request example of sending sms with the new API:

POST https://api.d7networks.com/messages/v1/send
Authorization: Bearer xxxxxxxx

{
    "message_globals": {
        "originator": "Apprise"
    },
    "messages": [
        {
            "channel": "sms",
            "content": "Hello world!",
            "recipients": [
                "+123456789"
            ]
        }
    ]
}

To get a Bearer token, create an application and generate token.

@caronc
Copy link
Owner

caronc commented Dec 18, 2022

I put a big PR in place.. I have not tested it though; I will follow through with the process of getting myself a D7 Network account and get back to you. The part of the code that i'm uncertain about is here.

Since the new API is so completely different and incompatible with the previous version; i can only assume the responses back from it will be different too.

@caronc
Copy link
Owner

caronc commented Dec 18, 2022

As an update to this; it's a similar situation to Plivo and this comment here. My D7 Networks account was deactivated and when i tried to sign up again, i had to fill out a form because i was using a gmail account.

Not sure if it will be rejected or not (as i don't have a company which is the minimum requirement to use this service). While i wait back, i made some more changes (dropping the extra QA on bulk notifications) and added more testing. I belive it may/should work, but will await your feedback.

Please see information on PR on how to test; I would be really appreciative of your feedback.

@dokime7
Copy link
Contributor Author

dokime7 commented Dec 19, 2022

I put a big PR in place.. I have not tested it though; I will follow through with the process of getting myself a D7 Network account and get back to you. The part of the code that i'm uncertain about is here.

Since the new API is so completely different and incompatible with the previous version; i can only assume the responses back from it will be different too.

There's no batch mode anymore on the new API, so I think you can remove this code.

Exemple of success sending:

HTTP/1.1 200 OK
Connection: keep-alive
Content-Length: 115
Content-Type: application/json
Server: APISIX/2.15.0
date: Mon, 19 Dec 2022 09:57:02 GMT

{
    "created_at": "2022-12-19T09:57:03.185526",
    "request_id": "cec14747-8cba-4fd3-a718-f510c9c315b9",
    "status": "accepted"
}

Exemple of bad token :

HTTP/1.1 401 Unauthorized
Connection: keep-alive
Content-Length: 119
Content-Type: application/json
Server: APISIX/2.15.0
date: Mon, 19 Dec 2022 09:56:21 GMT

{
    "detail": {
        "code": "ACCESS_TOKEN_SIGNATURE_VERIFICATION_FAILED",
        "message": "Access token signature verification failed"
    }
}

Sending with bad phone number returns HTTP 200 also. It seems that there is no check on phone number and in d7 async task either.

@dokime7
Copy link
Contributor Author

dokime7 commented Dec 19, 2022

I will try to test the PR

@caronc
Copy link
Owner

caronc commented Dec 28, 2022

Closing this issue off as the code has been merged (and available in the release i put out today)

@caronc caronc closed this as completed Dec 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants