question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error while accepting request via API

See original GitHub issue

Like discussed here https://gitter.im/HewlettPackard/squest?at=63038a0c9994996293ffe438 I am trying to implement a custom approval business logic in a python filter triggered by a global hook on request submission.

After some debug on the python module itself, I tried to use the “accept/reject” api via CURL to reduce the debug complexity, but it still throws an error.

That’s the curl command :

curl -vvv -X POST "https://[...]/api/service_catalog/request/233/accept/" -H "accept: application/json" -H "authorization: Bearer [...]"

And the error is :

{"required":"This field is required.","null":"This field may not be null.","invalid":"Invalid data. Expected a dictionary, but got {datatype}."}

Please note that :

  • Request is in the “Submitted” state
  • Same error is thrown when calling the “reject” api (https://[…]/api/service_catalog/request/233/reject/)
  • The “cancel” api is working as expected

Seems like I am missing some parameters, but looking at the swagger those apis don’t need any payload, just request id in query string.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Sispheorcommented, Sep 5, 2022

We’ve identified a bug. The request cannot be accepted when a survey is not defined.

0reactions
Sispheorcommented, Sep 12, 2022

The dev image is built automatically. You can use the “dev” tag when pulling it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Best Practices for REST API Error Handling - Baeldung
The simplest way we handle errors is to respond with an appropriate status code. Here are some common response codes: 400 Bad Request...
Read more >
How do you know what's gone wrong when your API request ...
When an API request doesn't work, hopefully the client receives a sensible HTTP error status, like 409 or 500, which is a good...
Read more >
Best practices for API error handling and troubleshooting
Go to Contact us page · Select 'Request type': API Incident -> There is a problem with an API used by my application...
Read more >
10 Error Status Codes When Building APIs For The First Time ...
Your API request may return error status codes such as “401 Unauthorized” or “502 Bad Gateway” when you begin using your API for...
Read more >
6 Frequently Occurring API Errors And How to Prevent Them
400 Bad Request ... This is almost always due to a typo in your user's input. But that doesn't mean you're off the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found