Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Server Discussions

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

Migrate Workflows via Admin API Powershell

igallion
7 - Meteor

Does anyone have an example of migrating workflows between Alteryx servers with Powershell 5.1? Specifically, I'm looking for an example of how to format the Multipart/Form-Data request to upload a workflow to the destination server (the Post /admin/v1/workflows/ endpoint).

13 REPLIES 13
JosephBih
5 - Atom

I did, and specify values for both but not even able to retrieve collections, a simple function indeed.  Does API calls require admin login or curator good enough?

 

$accessToken = invoke-restmethod -uri $baseaddress/oauth2/token -method POST -body $tokenRequestBody

 

$headers = @{
'Authorization' = 'Bearer ' + $accessToken
}
$collections = Invoke-RestMethod -Uri $baseaddress/v3/workflows -Method GET --header $headers

apathetichell
19 - Altair

Curator or Artisan?  documentation says Curator is good enough - but some things will require Admin... my memory is that it's better to be an admin for most of these things?

JosephBih
5 - Atom

Hi Guru, not sure where I missed out, but ran the code successfully with key/secret, no workflow uploaded.  Any idea why?

apathetichell
19 - Altair

No response when running $collections ?