Trying to run the scribejava library from GitHub to run a simple get from Trello Rest API
I Included the KEY and KEY Secret Tokens then I requested the access Token.
I tried the following example in eclipse: scribejava/scribejava-apis/src/test/java/com/github/scribejava/apis/examples/TrelloExample.java / .
I used these jars:
scribejava-apis-8.1.0.jar
scribejava-core-8.1.0.jar
I only modified these lines with codes I grabbed from the Trello website.
private static final String API_KEY = “your_api_key”;
private static final String API_SECRET = “your_api_secret”;
This data was used successfully in POSTMAN to fetch the “me” data from Trello via Rest.
I see that my POST to get an access token we returned with a {code=400, message=‘Bad Request’} response.
The following code is from the the latest version of scribejava api. (scribejava-8.1.0)
Here is the code involved in the error:
(Code from OAuth10aService.java)
final OAuthRequest request = prepareAccessTokenRequest(requestToken, oauthVerifier);
try (Response response = execute(request)) {
return api.getAccessTokenExtractor().extract(response);
(Values from Debug)
requestToken = com.github.scribejava.core.model.OAuth1RequestToken@a*******
oauthVerifier = https://trello.com/1/OAuthAuthorizeToken?oauth_token=******************
(Code from OAuth10aService.java)
return api.getAccessTokenExtractor().extract(response);
Values from Debug)
request= @request(POST https://trello.com/1/OAuthGetAccessToken)
response{code=400, message=‘Bad Request’, body=‘null’,
headers={null=HTTP/1.1 400 Bad Request,
X-Dns-Prefetch-Control=off,
Server=globaledge-envoy,
Access-Control-Allow-Origin=*,
Access-Control-Allow-Methods=GET,
PUT, POST, DELETE,
X-Permitted-Cross-Domain-Policies=none, Referrer-Policy=strict-origin-when-cross-origin,
X-Frame-Options=DENY, Strict-Transport-Security=max-age=63072000;
preload, Access-Control-Expose-Headers=x-rate-limit-api-key-interval-ms,
x-rate-limit-api-key-max, x-rate-limit-api-key-remaining,
x-rate-limit-api-token-interval-ms,
x-rate-limit-api-token-max, x-rate-limit-api-token-remaining,
X-Trello-Environment=Production, X-Trello-Version=1.2333.0,
Surrogate-Control=no-store, Content-Length=15,
}}