Alteryx Designer Desktop Discussions

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

How to get API to get information from the server

JohnLight
8 - Asteroid

I'm trying to get data from the server using the server api tool, and I'm getting this error (see attachment). The URL I'm using the just the gallery url, and I got the key and secret key from the gallery profile as well, so I don't believe those are the issues. I have the API access permission checked under the gallery profile as well. Any help would be appreciated.

 

I posted this in the server discussions as well, but there hasn't been a response yet, so I thought I'd try here.

44 REPLIES 44
apathetichell
19 - Altair

run retrieve all collections first -> and then look at the output for the collection id.

https://help.alteryx.com/20223/en/server/api-overview/alteryx-server-api-v3/server-api-v3-objects/co...

 

curl --location --request GET 'http://localhost/webapi/v3/collections?view=Full' \ --header 'Authorization: Bearer BearerTokenGoesHere'

 

 

JohnLight
8 - Asteroid

Where do you run this? Just any command line? And where do I find the bearer token?

apathetichell
19 - Altair

try going through the postman collection. order of operations should be:

1) retrieve token.

2) call collections endpoint.

if you are using a packaged macro and they don't provide it - i'd recommend going thorugh the alteryx server postman collection to:

1) see the authentication flow

2) send your token to the collection endpoint. 

 

you should then able to replicate it in alteryx.

JohnLight
8 - Asteroid

Postman collection is something separate from Alteryx? If I make an account, then I can follow those steps?

apathetichell
19 - Altair

https://help.alteryx.com/20223/en/server/api-overview/alteryx-server-api-v3/how-to-use-postman.html#... -> 

Postman is a great external api collection/testing program. we use it to build out our api logic - which we can then transfer to alteryx workflows.

 

Alteryx Server has a swagger  -> you should be able to test collections there as well.

JohnLight
8 - Asteroid

I followed this example here exactly, but while in the video their workflow completed with msg HTTP 200, I got HTTP/1.1 404 Not FoundContent-Length: 0Server: Microsoft-HTTPAPI/2.0

 

I will look at Postman and see if that can help. I've looked at the swagger page before, but haven't got it to work still.

Alteryx Server Series 2022: How to Build Gallery API (youtube.com)

an_drew72
5 - Atom

community user id?

 

JohnLight
8 - Asteroid

I got this error trying to use Postman

JohnLight
8 - Asteroid

It seems like my key and secret key aren't being accepted anywhere, even though I'm getting them from the server -> my profile -> scroll down to bottom for API keys. I don't know why, but from alteryx and postman, that's what it looks like to me.

OllieClarke
15 - Aurora
15 - Aurora

Hey @JohnLight 

It might be easier to run through the full process here to get collections.

 

Step 1, get you api keys from your profile (not in admin)

(I'm hiding my key with the google window)(I'm hiding my key with the google window)

 

Step 2: confirm the api url by using the inbuilt swagged documentation

click on api docs in server helpclick on api docs in server helptake everything before //swaggertake everything before //swagger

Step 3: use those keys along with the api url to login with the server api tool

image.png

 

Step 4: Use the /v3/collections/{collectionid} endpoint. To find the collectionId, in your browser take the alphanumeric string from the end of the collection url when in that collection
image.png

This is all based on the assumption that you have permissions to use the API. Check your permissions in your user profile

image.png

Polls
We’re dying to get your help in determining what the new profile picture frame should be this Halloween. Cast your vote and help us haunt the Community with the best spooky character.
Don’t ghost us—pick your favorite now!
Labels