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 Server Discussions

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

Server API update workflow not working

gabrielvilella
14 - Magnetar

I am trying to update an existing workflow using the endpoint PUT /v3/workflows/{workflowId}. I have created the updateWorkflowContract and have the workflowId on another field. The response that I am getting is this:

Server API PUT (12) The request to http://alteryx.datameaning.me/webapi/v3/workflows/61ce65c60ecb34130c61c6bf failed with an HTTP 400 Bad Request error. Error message: The request is invalid.

 

I get the same response if I try from Swagger. I have already tried inserting another number, higher and lower, for the version ID, but nothing works. 

 

Ultimately what I am trying to do is to change a series of workflows from public to private. The user running the API call is not the owner of the workflow, but it's a curator. I have added the user to the studio where the workflow is located, no luck. 

 

updateWorkflowContract

 

 

{
  "name": "challenge_8_start_file",
  "versionId": "1",
  "makePublished": true,
  "ownerId": "5f8490490ecb3409443f39d2",
  "workerTag": "",
  "districtTags": [
    ""
  ],
  "comments": "",
  "isPublic": false,
  "isReadyForMigration": false,
  "othersMayDownload": true,
  "othersCanExecute": true,
  "executionMode": "Standard",
  "hasPrivateDataExemption": false
}

 

 

 

Response

 

 

{
  "message": "The request is invalid.",
  "modelState": {
    "updateWorkflowContract.VersionId": [
      "The provided version ID is invalid."
    ]
  }
}

 

 

 

The published workflow version is 1.

gabrielvilella_0-1666811259273.png

Server version: 2022.1.1.30961

 

1 REPLY 1
AlanY
Alteryx
Alteryx

@gabrielvilella - The reason you're getting that error is because you're using the versionNumber value instead from your workflow instead of the versionId. 

 

  • In order to get the versionId value for your workflow, you will need to use the GET /v3/workflows/{workflowId} endpoint. 
  • The GET /v3/workflows/ endpoint will only return the versionNumber for your workflows and not the needed versionId.