Server API update workflow not working
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
Server version: 2022.1.1.30961
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@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.
