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

Add filter by session name to /api/sessions #300

Closed
7 tasks done
allburov opened this issue Apr 19, 2024 · 3 comments
Closed
7 tasks done

Add filter by session name to /api/sessions #300

allburov opened this issue Apr 19, 2024 · 3 comments
Labels
engine:ALL Related to all engines or basic mechanisms enhancement New feature or request patron:PRO

Comments

@allburov
Copy link
Contributor

allburov commented Apr 19, 2024

It would be useful to have the ability to filter the result of "/api/session" end point with a single session name.
With this feautures i'm able to know the state of the session.

Originally posted by @giovannicarella in #299

  • Add GET /api/sessions/{name}
  • Mentioned endpoint in documentation
  • Add changelog (issue + doc links)
  • Split commits - CORE, PLUS
  • Bump version
  • Release it WAHA PLUS
  • Mention it's been fixed
@allburov allburov added enhancement New feature or request engine:ALL Related to all engines or basic mechanisms labels Apr 19, 2024
@devlikepro
Copy link
Contributor

devlikepro commented Apr 21, 2024

Hi! Added in 2024.4.4 (WAHA Plus).

Make sure to update the image and restart the container.


Get session

To get information about a specific session - call GET /api/sessions/{session}.

{
  "name": "default",
  "status": "WORKING",
  "config": {
    "proxy": null,
    "webhooks": [
      {
        "url": "https://httpbin.org/post",
        "events": [
          "message",
          "session.status"
        ],
        "hmac": null,
        "retries": null,
        "customHeaders": null
      }
    ],
    "debug": false
  },
  "me": {
    "id": "79111111@c.us",
    "pushName": "WAHA"
  },
  "engine": {
    "engine": "NOWEB"
  }
}

patron:PRO

@MadhabaPatra
Copy link

Hi @devlikepro / @allburov

If the {session} is not available, we should return a 404 error, similar to how it's handled in sessions/{session}/me.

data: {
  statusCode: 404,
  message: "We didn't find a session with name '{session}'. Please start it first by using POST /sessions/start request",
  error: 'Not Found'
}

This ensures consistency in error handling across endpoints and provides clear guidance to users when a session is not found.

@devlikepro
Copy link
Contributor

devlikepro commented May 15, 2024

@MadhabaPatra yep, totally agree!Created a new issue for that, #333

patron:PRO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
engine:ALL Related to all engines or basic mechanisms enhancement New feature or request patron:PRO
Projects
None yet
Development

No branches or pull requests

3 participants