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

QR URL for easyAPI #3016

Open
1 task done
scropion86 opened this issue Jan 16, 2023 · 13 comments
Open
1 task done

QR URL for easyAPI #3016

scropion86 opened this issue Jan 16, 2023 · 13 comments

Comments

@scropion86
Copy link
Contributor

Are you using the latest version of the library?

  • I have checked and am using the latest version of the library.

What type of session are you experiencing this issue on?

Multi-device and I have set multiDevice to true in my config OR am using the --multi-device flag

What type of host account are you experiencing this issue on?

Personal account (normal)

Mode

EASY API/CLI

Current Behavior

When enabling --ezqr --popup true --ev 'https://webhook.site/7dce32e9…..

the webhock received everything at launch except the QR URL such this message “Scan the qr code at https://qr.openwa.cloud/1681d”

and since I enabled popup flag I was expecting to be able to see the QR from “server:port/qr" but because I am using API key o got “{"error":"unauthorised"}”

Expected Behavior

  • should receive the QR URL in webhook launch events
  • should be able to access “server:port/qr" without API Key

Steps To Reproduce

npx @open-wa/wa-automate -p 1234 --ezqr --popup true --ev 'https://webhook.site/7dce32e9-561d-4.........'

create() code OR full CLI command + CONFIG

npx @open-wa/wa-automate -p 1234 --ezqr --popup true --ev 'https://webhook.site/7dce32e9-561d-4.........'

DEBUG INFO

┌─────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│       (index)       │                                                                   Values                                                                   │
├─────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│     WA_VERSION      │                                                                 '2.2301.6'                                                                 │
│       PAGE_UA       │ 'WhatsApp/2.2147.16 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36' │
│ WA_AUTOMATE_VERSION │                                                                  '4.55.0'                                                                  │
│   BROWSER_VERSION   │                                                       'HeadlessChrome/109.0.5412.0'                                                        │
│         OS          │                                                                'Linux 5.15'                                                                │
│      START_TS       │                                                               1673879684176                                                                │
│      RAM_INFO       │                                                      'Total: 8.20 GB | Free: 7.25 GB'                                                      │
│    PPTR_VERSION     │                                                                  '19.5.2'                                                                  │
└─────────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

Environment

- OS: 
- Node: 
- npm:

Screenshots/Logs

No response

Anything else?

No response

@fire17
Copy link

fire17 commented Jan 17, 2023

watching :)

  • can anyone share a link to docs where this is officially covered ?

i am spinning up open-wa with npx on a python subprocess, i can create a new directory, open the process from there,
and get a fresh wa api ready for qr scanning... I wish to know how to export it and also get the changing qr if it wasn't scanned it time. I assume this is what the webhook option is for.. Some guidance or material would help :) thanks alot

@scropion86
Copy link
Contributor Author

scropion86 commented Jan 19, 2023 via email

@scropion86
Copy link
Contributor Author

scropion86 commented Jan 19, 2023

watching :)

  • can anyone share a link to docs where this is officially covered ?

i am spinning up open-wa with npx on a python subprocess, i can create a new directory, open the process from there, and get a fresh wa api ready for qr scanning... I wish to know how to export it and also get the changing qr if it wasn't scanned it time. I assume this is what the webhook option is for.. Some guidance or material would help :) thanks alot

if you mean documentation for EASY API CLI here is the Link
https://openwa.dev/docs/configuration/command-line-options

@smashah
Copy link
Member

smashah commented Jan 20, 2023

something is missing here, how are you getting {"error":"unauthorised"} if:

  • you don't have -k in your command (are you using cli.config.json?)
  • that authentication layer is only available once the api is up and the session is running?

Can you show me a screen recording (including terminal) of you experiencing this problem please + -v logs

@smashah
Copy link
Member

smashah commented Jan 20, 2023

Also @scropion86 @fire17 you can constantly refresh that --ezqr image as it is not cached and always returns the latest qr code (albeit with a delay of upload).

@fire17
Copy link

fire17 commented Jan 20, 2023

Thanks @scropion86 for the cli docs link, i've learned of a few more things that are possible
even though it didnt mention the qr there,
since im using the api with python, I usually go by https://openwa.dev/docs/api/classes/api_Client.Client
but again no mention there of onQR event

@smashah could you please advise ?
for me the best case scenario is to have an event from the client (like any other) where it fires every time a qr is prompted
This way I can update any open socket to my site with an updated qr for me to scan remotely
Please let me know if this is possible or how this could be done otherwise from my env?..
Thanks a lot 🙏 😇

@scropion86
Copy link
Contributor Author

something is missing here, how are you getting {"error":"unauthorised"} if:

  • you don't have -k in your command (are you using cli.config.json?)
  • that authentication layer is only available once the api is up and the session is running?

Can you show me a screen recording (including terminal) of you experiencing this problem please + -v logs

sorry for confusing you , the error {"error":"unauthorised"} was a result from other session which -k was used.
and i am not using cli.config.json

@smashah
Copy link
Member

smashah commented Jan 21, 2023

@fire17 have you tried the python socket client?

https://github.com/open-wa/wa-automate-socket-client-python

@scropion86 ok so there should be no limitations on the popup URL. What is the remaining problem then?

@scropion86
Copy link
Contributor Author

--ezqr URL is not sent to the webhook if --ev 'https://webhook.site/7dce32e9…..

@smashah
Copy link
Member

smashah commented Jan 21, 2023

todo:

  • qrUrl event namespace should be added to default ef

@smashah
Copy link
Member

smashah commented Jan 21, 2023

@github-actions run

⚡ Release! ⚡
(async () => {
function exec(cmd) {
try {
	execSync(cmd, {stdio: 'inherit'})
}  catch (error) {
    console.log(`Status Code: ${error.status} with '${error.message}'`);
 }
}
//set the version type
process.env.VERS = "patch"

// Config
const gitUserEmail = "github-actions[bot]@users.noreply.github.com";
const gitUserName = "github-actions[bot]";

exec(`echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc`);
exec(`git config --global user.email "${gitUserEmail}"`);
exec(`git config --global user.name "${gitUserName}"`);
exec(`npm i -D`);
exec(`npm run release-ci $VERS`);

// types only package
exec('npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN')
exec(`npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN && npm run types:publish `);
exec(`git commit -a -m 'updated types-only package'`);
exec(`git push --force`);

//comment on the issue
var result = execSync(`npx auto-changelog -o ./tempchangelog.txt --commit-limit false --template ./compact-keepachangelog.hbs --stdout`).toString();

    await postComment(result);

//create changelog image
exec(`npm run release-image`);
exec(`git commit -a -m 'updated release-image'`);
exec(`git push --force`);
  })();

@smashah
Copy link
Member

smashah commented Jan 21, 2023

Changelog

🚀 Release 4.55.2 (2023-01-21)

@fire17
Copy link

fire17 commented Jan 21, 2023

@fire17 have you tried the python socket client?

https://github.com/open-wa/wa-automate-socket-client-python

Yes @smashah this is exactly what I am using
I figured my issue should go there perhaps... Getting QR to client before connection #7
(hope you watch the issues there as you do here lol 😋 )

@smashah smashah mentioned this issue Feb 10, 2023
1 task
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

3 participants