caronc / apprise

Apprise - Push Notifications that work with just about every platform!
https://hub.docker.com/r/caronc/apprise
BSD 2-Clause "Simplified" License
10.9k stars 384 forks source link

Clicksend usernames as email address #1103

Closed MaleNurse closed 1 month ago

MaleNurse commented 2 months ago

:mega: Notification Service(s) Impacted Clicksend

:lady_beetle: Describe the bug Usernames are email addresses and the config does not accept them due to "@" being used prior to setting the target phone number. I can't find a way to change/create a simple username in the Clicksend dashboard. Perhaps there is a way to utilize the REST API and specify our username akin to how this is done in the email setup?

:computer: Your System Details:

caronc commented 2 months ago

Try using ?user=your@email.address or you can also just escape the @ (see here) with %40

caronc commented 2 months ago

To further your comment, i like the idea of remapping how content is parsed, but would that impact users who don't use an email address? I recall setting this up (my acccount has long expired as it's been a while), i had a regualr user id (not email). - I could be wrong here though (it's the reason i'm asking :slightly_smiling_face: )

If i change it to the format you suggest, i would break the current design for others.

Thoughts?

MaleNurse commented 2 months ago

So both suggestions placed the correct strings into the user/pass according to the CLI -vvvv output (assuming clicksend is accepting the escaped @), but I'm getting 401 invalid credential errors w/ both my acct password and API key

luckman212 commented 1 month ago

Came here to report the same. Getting

DEBUG - ClickSend POST URL: https://rest.clicksend.com/v3/sms/send (cert_verify=True)
DEBUG - ClickSend Payload: {'messages': [{'source': 'php', 'body': 'HelloWorld', 'to': '+1646XXXXXXX'}]}
WARNING - Failed to send 1 ClickSend notification to 1646XXXXXXX: Unauthorized - Invalid Token., error=401.
DEBUG - Response Details:
b'{"http_code":401,"response_code":"UNAUTHORIZED","response_msg":"Authorization failed.","data":null}'

apprise 1.7.6, I verified my credentials (I use a username:apikey, not email address)

caronc commented 1 month ago

Okay, I'll resign up and investigate

caronc commented 1 month ago

I was able to reproduce your issue and fixed it in this latest PR.

I also can confirm that I signed up with them a loonng time ago and they didn't have as heavy restrictions as they do today. But my login of l2g is grandfathered in (not an email). I had to use clicksend://l2g:apikey/... to work. Basically I won't be able to do the email request to rework the URL otherwise it would break for others (me included :wink: ).

caronc commented 1 month ago

Closing issue; check out @master branch and you'll be good to go. I'll do a new release hopefully next week.