ALTERYX INSPIRE | Join us this May for for a multi-day virtual analytics + data science experience like no other! Register Now
The Alteryx Community will be temporarily unavailable for a time due to scheduled maintenance on Thursday, April 22nd. Please plan accordingly.

Alteryx Server Discussions

Find answers, ask questions, and share expertise about Alteryx Server.

Java client - Sample Code for Alteryx API

6 - Meteoroid

Please help oauth generation java code to call apis.


6 - Meteoroid

I got some basic working code.  The details below.



Working Code Below:

import org.scribe.builder.api.DefaultApi10a;
import org.scribe.model.*;

import java.util.Map;

public class ScribeJavaMain {
    private static final String url ="https://";
    private static final String key ="YOUR_KEY_HERE";
    private static final String secret ="YOUR_SECRET_HERE";
    public static void main(String[] args) {
        DefaultApi10a api = new DefaultApi10a() {
            public String getRequestTokenEndpoint() {
                return null;

            public String getAccessTokenEndpoint() {
                return null;

            public String getAuthorizationUrl(Token requestToken) {
                return null;

        OAuthRequest request = new OAuthRequest(Verb.GET,url);
        request.addOAuthParameter(OAuthConstants.TIMESTAMP, api.getTimestampService().getTimestampInSeconds());
        request.addOAuthParameter(OAuthConstants.NONCE, api.getTimestampService().getNonce());
        request.addOAuthParameter(OAuthConstants.CONSUMER_KEY, key);
        request.addOAuthParameter(OAuthConstants.SIGN_METHOD, api.getSignatureService().getSignatureMethod());
        request.addOAuthParameter(OAuthConstants.VERSION, "1.0");
        String baseString = api.getBaseStringExtractor().extract(request);
        String signature = api.getSignatureService().getSignature(baseString, secret, "");
        request.addOAuthParameter(OAuthConstants.SIGNATURE, signature);
        for (Map.Entry<String, String> entry : request.getOauthParameters().entrySet())
            request.addQuerystringParameter(entry.getKey(), entry.getValue());
        Response response2 = request.send();



Dependencies :