Skip to content

fix: Incorrect response received when providing space before invalid orgId #1220

@sayali-chavan2396

Description

@sayali-chavan2396

Description:
When a space is provided before an invalid OrgID during the 'Retrieve the details of the webhook URL for an organization' API call, the response returns a 500 Internal Server Error. The expected behavior is that the space should be automatically trimmed, and a 400 Bad Request response should be returned

Method

GET/v1/webhooks/orgs/webhookurl (Get Webhook URL Details)

Steps to Reproduce

  1. Make an API call to the 'Retrieve the details of the webhook URL for an organization' endpoint, passing an 'orgId' parameter that includes a space before the invalid OrgID
  2. Observe the response.

Current behavior

{
"statusCode": 500,
"message": "Something went wrong!",
"error": "Internal Server error"
}

Expected behavior

The space in the OrgID should be automatically trimmed, and if the OrgID is invalid, a Bad Request error with a 400 status code should be returned
{
"statusCode": 400,
"message": "Please provide valid orgId",
"error": "Bad Request"
}

Screenshot

Image

Metadata

Metadata

Assignees

Labels

Type

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions