Skip to main content

Trying to hit the Cribl APi in postman and successfully able to get the output but while hitting the API with same configurations in the Cribl Rest collector it gives status code 400, any reason?

Can you share more of what you're doing?


How have you configured the REST collector?


Trying to create google pub/sub source with Cribl API via Cribl rest collector


Have passed the /system/input endpoint in the collect url and given the json payload in post body and given the cribl bearer token in authorization


Can you share a screenshot of your config?


Sure


Make sure you're sending a POST and that you've also set the `Content-Type: application/json` header. 400 means bad method/input.


<@U01LSBF5953&gt;


What's in the POST body?


FYI that's a Javascript field so you might be sending "undefined" as the payload instead of your intended JSON


The whole payload with type= google_pubsub


Make sure you put quotes around the entire POST body to send it correctly


Also, make sure you add all the required elements:https://docs.cribl.io/api -> schemas -> InputGooglePubsub


<@U01J549PR6Y&gt; <@U01LSBF5953&gt; Thanks!! but am still unable to do so


Is this a standalone instance or Leader you're working with?


<@U01LSBF5953&gt; One more addtional questionIs it possible to use Oauth2.0 in custom collector ?


<@U01LSBF5953&gt; It's a standalone instance


Hey <@U01LSBF5953&gt; This is interesting 🤔 the grant type I'm having troubles with is ‚Äòpassword credentials' which requires a username and password. I'm assuming that's not supported doing the method above right?


Yes, OAuth2 (client_credentials flow) is supported for authentication.


Reply