Alteryx designer Discussions

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

Download access token & data from the Genesys Purecloud API

Highlighted
5 - Atom

Hi Folks

 

I want to get an access token & data from the Genesys Purecloud API.  I have tried various ways to put the information into the download tool but have not been able to get a token, let alone data!

 

The Genesys DeveloperForum doesn’t mention Alteryx & the Alteryx Community doesn’t mention Purecloud.

 

Attached is my workflow (2018.4). 

SusanDDay_0-1590034974210.png

 

 

Below are pics of each tool as well as links to the doco that specifies the input, the requests & the JSON response containing the token.

 

Don't know what I am doing wrong, but hope someone out there can spot it

Susan

 

  1. Here is my input data (client credentials are deidentified).  When I use the real ClientID & Secret & derived Authorization, I get the same DownloadData & Headers as with these dummy values
    1. SusanDDay_1-1590034974216.png
  2. These are the steps to base encode ClientID&Secret for the Authorization field
    1. SusanDDay_2-1590034974218.png
    2. SusanDDay_3-1590034974219.png
    3. SusanDDay_4-1590034974220.png
  3. Here is the download tool (I have also tried using the other URL fields from the above text input):
    1. SusanDDay_5-1590034974223.png
    2. SusanDDay_6-1590034974225.png
    3. Whether I check TokenPost on the Payload tab or not, I get the same result in DownloadData & DownloadHeaders
    4.      SusanDDay_7-1590034974227.png
    5.      SusanDDay_8-1590034974230.png
    6. SusanDDay_9-1590034974231.png
  4. The DownloadData field contains (contextid varies):

{"message":"HTTP 404 Not Found","code":"not found","status":404,"contextId":"5b25a7b0-191d-4b3c-8846-44255f518204","details":[],"errors":[]}

  1. The DownloadHeaders field contains:

HTTP/1.1 200 Connection Established

Proxy-Agent: Zscaler/6.0

HTTP/1.1 404 Not Found

Content-Type: application/json

Content-Length: 140

Connection: keep-alive

Date: Wed, 20 May 2020 22:33:39 GMT

ININ-Correlation-Id: 5b25a7b0-191d-4b3c-8846-44255...

  1. Instructions on URLs, variables and values re:
    1. The API URL (https://developer.mypurecloud.com/api/rest/)
      1.      SusanDDay_10-1590034974231.png
    2. The requests (https://developer.mypurecloud.com/api/rest/authorization/use-client-credentials.html)
      1. SusanDDay_11-1590034974237.png
Highlighted
8 - Asteroid

Looks like they're using OAuth.

 

This means you'll likely need two Download Tools:

 

1. First one to present your credentials and receive a token in return. Double check which parts of the payload are base64 encoded, it may just be the credentials individually. 

 

2. Second download tool to pass the token to an API. The URI you have below may be scrubbed, but its likely that it will be of the form "https://api.mypurecloud.com.au/api/rest/api/v2/..."

 

Working with web services like this, it can be helpful to use a tool like Postman (https://www.postman.com/) to get the two requests down, and then build out the Alteryx tools to fit. 

 

As an alternative, you could probably leverage the Python SDK (https://developer.mypurecloud.com/api/rest/client-libraries/python/) and a Python tool to connect to the site. 

 

Hope this helps!

Matt

 

Highlighted
5 - Atom

Thanks for responding Matt

 

Agreed re Oauth & 2 download tools.  I have checked the B64 encoding too.  If I ever get to the 2nd download tool I will try that URI "https://api.mypurecloud.com.au/api/rest/api/v2/..."  !

 

I was hoping not to have to go down the postman & python paths, but you suggesting them makes me think that might have to be the next step

- they have tutorials with Python code eg https://developer.mypurecloud.com/api/tutorials/oauth-client-credentials/?language=python&step=1.

- & if I can install postman I might work through...

https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/APIs-in-Alteryx-cURL-and-Download-T...

 

Fingers crossed, let's see what another day brings!

Labels