You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 5, 2019. It is now read-only.
I am using apache jersey client libraries to develop StashBoard API client which will allow me to update status of a particular service using client program.
I am using following code in java to create Oauth consumer:
private void CreateOAuthClient() {
this.sbClient = Client.create();
this.sbOAuthParams = new OAuthParameters();
this.sbOAuthSecrets = new OAuthSecrets();
this.sbOAuthParams.consumerKey(this.SB_CONSUMER_KEY).signatureMethod("HMAC-SHA1");
this.sbOAuthSecrets.consumerSecret(this.SB_CONSUMER_SECRET);
this.sbOAuthParams.token(this.SB_OAUTH_TOKEN_KEY).signatureMethod("HMAC-SHA1");
this.sbOAuthSecrets.tokenSecret(this.SB_OAUTH_TOKEN_SECRET);
this.sbOAuthClientFilter = new OAuthClientFilter(sbClient.getProviders() , sbOAuthParams, sbOAuthSecrets);
this.sbWebResource = this.sbClient.resource(strBaseUrl);
this.sbWebResource.addFilter(sbOAuthClientFilter);
}
But when I try to do a POST I get HTTP 400 error. The code to call POST on /api/v1/services/{service}/events is as follows:
BTW the service defination expects a JSON object right ?? (At least that is what I could find out by looking client examples for PHP/ruby on your website)
The text was updated successfully, but these errors were encountered:
The Services list resource expects is data to be in the form of url-encoded parameters. In your email you mentioned you set the data type to APPLICATION_FORM_URLENCODED. Did you make sure to actually urlencode the data?
Hello,
I am using apache jersey client libraries to develop StashBoard API client which will allow me to update status of a particular service using client program.
I am using following code in java to create Oauth consumer:
private void CreateOAuthClient() {
this.sbClient = Client.create();
But when I try to do a POST I get HTTP 400 error. The code to call POST on /api/v1/services/{service}/events is as follows:
JSONObject newEvent = new JSONObject();
newEvent.put("status", "up");
newEvent.put("message", "working again!!!");
sbWebResource.path("services").path(prmServiceId).path("events").type(MediaType.APPLICATION_JSON_TYPE).post(newEvent);
Please let me know if I am doing something wrong.
BTW the service defination expects a JSON object right ?? (At least that is what I could find out by looking client examples for PHP/ruby on your website)
The text was updated successfully, but these errors were encountered: