Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Alteryx Oauth10a Java Library Signpost Alternative API

Colgan
ACE Emeritus
ACE Emeritus

I'm working on adding an Alteryx API call from a Java Application. 
Presently using Signpost library and successfully able to make the GET calls,
but trying to Sign the POST call with the JSON body to execute an 
Alteryx Workflow ends up with a 401 -  Unauthorized error. 
Signpost states it is not intended for doing posts, but have been able to create a post with parameters. 
The JSON in the post-body is failing.

Does anyone have a working java example to submitting a post with JSON parameters that they could share?

Suggestions on a Java Library that handles the Oauth 1.0a post?

An ability to debug what Alteryx server is receviing/expecting that causes the 401 Unauthorized Alteryx Server side?

I have successfully created Alteryx Oauth API calls with other languages, but I seem to be stuck solving this in Java.

Thank you!

Regards,
John Colgan

 

Additional Info: 

Works Fine using the JavaScript Page

JSON  Payload --->  {"questions":[{"name":"Text Box (2)","value":"John"},{"name":"Numeric Up Down (3)","value":"22"}]}
https://www.alteryx.example.com:443/gallery/api/v1/workflows/588b6a77d0d95f0d34cba2a7/jobs/
oauth_consumer_key 8D4469D7B2CFD1944cd93522
oauth_nonce 22c6f6a93f257a0046fa7fe
oauth_signature_method HMAC-SHA1
oauth_timestamp 1493150579
oauth_version 1.0
[SIGNPOST] SBS: POST&https%3A%2F%2Fwww.alteryx.example.com%2Fgallery%2Fapi%2Fv1%2Fworkflows%2F588bd95f0d34cba2a7%2Fjobs%2F&oauth_consumer_key%3D8D4469f315e0a0ac8749bf640332c21944cd93522%26oauth_nonce%3D22c6f6a93a57a0046fa7fe%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1493150579%26oauth_version%3D1.0
[SIGNPOST] signature: U+U/BdfLGVGwVnDIupr0xFyze78=
[SIGNPOST] Auth Header: OAuth oauth_consumer_key="8D4469D7B2c21944cd93522", oauth_nonce="22c6f6820046fa7fe", oauth_signature="U%2BU%2FBdfLGVGwVnDIupr0xFyze78%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1493150579", oauth_version="1.0"
[SIGNPOST] Request URL: https://www.alteryx.example.com:443/gallery/api/v1/workflows/588b6a77d0d95f0d34cba2a7/jobs/
Response: 500 Internal Server Error

9 REPLIES 9
AngelaO
Alteryx Alumni (Retired)
Colgan
ACE Emeritus
ACE Emeritus

Not Accepted as a Solution to the Java question.  :(  

 

Please call or email.  After a success then will post the solution to the Community.

Colgan
ACE Emeritus
ACE Emeritus

implementation success using the specific version of scribejava:   scribejava version 1.3.7.  ( kudo's Charles Ragan and all involved ) Alteryx Java API Client

Alteryx Java API Client Based on https://gallery.alteryx.com/gallery/api-docs

 

Dependencies:

  1. scribejava version 1.3.7 oauth 1.0a API two-legged https://github.com/scribejava/scribejava/tree/1.3.6
  2. Apache Commons Codec commons-codec-1.10.jar https://commons.apache.org/proper/commons-codec/
ssamudrala
5 - Atom

Do we have working Java code using the Alteryx REST API? 

 

Any example you can suggest here: https://github.com/scribejava/scribejava/tree/master/scribejava-apis/src/test/java/com/github/scribe...?

Flow : First obtaining customerkey/secretkey usign API Docs --> This is pretty straightforward. Able to get them.

 

Tried with Postman, after setting Oauth 1.0, able to get the response. 

 

http://HOSTNAME:80/gallery/api/v1/workflows/subscription/?oauth_consumer_key=KEY&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1504895899&oauth_nonce=kFqsf9&oauth_version=1.0&oauth_signature=SIGNATURE.

 

Tried with few Java Libraries : Getting Signature mismatch issues OR 500 Error from the alteryx? 

 

Appreciate if you have working code...

 

 

 

ssamudrala
5 - Atom

API is working with Scribe.

 

Facing issues with Questions Payload for queuing the job.

Does Alteryx has any REST API Guide how to use? Need help in sending the list data etc...

sampathkumar
5 - Atom

Can you post what classes in Scribe got used, I didn't found any specific examples in https://github.com/scribejava/scribejava/tree/master/scribejava-apis/src/test/java/com/github/scribe...

 

Can you please share how were you able to retrieve Signatures from Signature Service. 

maxcontact
5 - Atom

could you post the sample java code please. I would like to know the way you are generating Oauth signature.

maxcontact
5 - Atom

@ Colgan- Could you please provide java solution code please.  I am facing issue while generating oAuth signature.

DeepakTyagi
8 - Asteroid

is it possible to post the java code/classes/sample

Labels