Alternative API Resource

HDC AV operations Web Services.

DELETE /api/av/alternatives

Delete given alternatives (drafts). Please note, that all versions in given alternative will be removed.

Request Body
media type data type description
application/json array of HdcSimpleIdTO (JSON) - List of alternatives IDs to be deleted
Response Body
media type data type description
application/json object (JSON) JSON response with information if deleting was successful or not

Example

Request
DELETE /api/av/alternatives
Content-Type: application/json
Accept: application/json

                
[ {
  "id" : 12345
} ]
                
              
Response
HTTP/1.1 204 No Content
Content-Type: application/json

                
...
                
              

DELETE /api/av/advanced/alternatives

Delete given alternatives (drafts) by advanced version manager. Please note, that all versions in given alternative will be removed.

Request Body
media type data type description
application/json array of HdcSimpleIdTO (JSON) - List of alternatives IDs to be deleted
Response Body
media type data type description
application/json HdcSuccessTO (JSON) JSON response with information if deleting was successful or not

Example

Request
DELETE /api/av/advanced/alternatives
Content-Type: application/json
Accept: application/json

                
[ {
  "id" : 12345
} ]
                
              
Response
HTTP/1.1 204 No Content
Content-Type: application/json

                
{ }
                
              

POST /api/av/advanced/revertpublish

Reverts published version into draft

Request Body
media type data type description
application/json HdcAlternativeTO (JSON) containing reverted version id, created name and description(optional) of created draft
Response Body
media type data type description
application/json HdcAlternativeTO (JSON) JSON Response with newly created draftId

Example of request:

{"tipVersionId":"5","alternativeName":"New Draft","alternativeDescription":"New draft description"}

Example of response:

{"alternativeId":"5"}

Example

Request
POST /api/av/advanced/revertpublish
Content-Type: application/json
Accept: application/json

                
{ }
                
              
Response
HTTP/1.1 201 Created
Content-Type: application/json

                
{ }
                
              

PUT /api/av/advanced/setpublishdate

Set Publish Date in given alternative(draft)

Example of request:

{"alternativeId":4375,"scheduledPublishDate":"2019-03-28T23:00:00.000Z"}

Request Body
media type data type
application/json HdcAlternativeTO (JSON)
Response Body
media type data type description
application/json HdcSuccessTO (JSON) JSON Response with version information and information if setting publishDate was successful or not

Example

Request
PUT /api/av/advanced/setpublishdate
Content-Type: application/json
Accept: application/json

                
{ }
                
              
Response
HTTP/1.1 204 No Content
Content-Type: application/json

                
{ }
                
              

DELETE /api/av/alternative/{alternativeId}

Delete given alternative (draft). Please note, that all versions in given alternative will be removed.

Request Parameters
name type description constraints
alternativeId path ID of alternative to be deleted long
Response Body
media type data type description
application/json HdcSuccessTO (JSON) JSON response with information if deleting was successful or not

Example

Request
DELETE /api/av/alternative/{alternativeId}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 204 No Content
Content-Type: application/json

                
{ }
                
              

PUT /api/av/alternative/{alternativeId}

Edit Name and Description of alternative (draft)

Example of request:

{"alternativeName":"MyDraftName","alternativeDescription":"MyDraftDescription"}

Request Parameters
name type description constraints
alternativeId path Id of private draft which will be updated long
Request Body
media type data type
application/json HdcAlternativeTO (JSON)
Response Body
media type data type description
application/json HdcSuccessTO (JSON) JSON Response with information if update was successful or not

Example

Request
PUT /api/av/alternative/{alternativeId}
Content-Type: application/json
Accept: application/json

                
{ }
                
              
Response
HTTP/1.1 204 No Content
Content-Type: application/json

                
{ }
                
              

POST /api/av/alternative/{versionId}

Create alternative(draft) from given version

Example of request:

{"label":"New Draft","description":"New draft description"}

Request Parameters
name type description constraints
versionId path ID of version which will be root of new alternative long
Request Body
media type data type description
application/json string (JSON) HdcAlternativeTO
Response Body
media type data type description
application/json HdcAlternativeTO (JSON) JSON Response with information if creation was successful or not

Example

Request
POST /api/av/alternative/{versionId}
Content-Type: application/json
Accept: application/json

                
...
                
              
Response
HTTP/1.1 201 Created
Content-Type: application/json

                
{ }
                
              

GET /api/av/alternatives/json

Get list of alternatives (drafts)

Request Parameters
name type description
mode query Could be "all" - all drafts from database, "private" - only created by current user or "shared" - only shared with current user
Response Body
media type data type description
application/json object (JSON) JSON response with list of private drafts

Example of response:

{"list":[{"owner":"jdo","ownerFullName":"John Doe","alternativeId":"10","alternativeName":"58914c17-91c2-44ff-823a-37075360a26c","alternativeDescription":"Draft","rootVersionId":"20","tipVersionId":"178656","creationDate":"2013-09-11T13:13:52.117936+02:00","scheduledPublishDate":"2019-03-28T23:00:00.000Z","isShared":true},{"owner":"maz","ownerFullName":"Maciej Zabielski","alternativeId":"11","alternativeName":"eafcafc2-2088-40c4-b159-452a995573c6","alternativeDescription":"Draft","rootVersionId":"20","tipVersionId":"178644","creationDate":"2013-09-11T17:17:37.408548+02:00","isShared":true}]}

Example

Request
GET /api/av/alternatives/json
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
...
                
              

GET /api/av/history/json

Get Master Archive history

Request Parameters
name type description constraints
limit query maximum number of versions returned long
offset query the number of the record from which the data will be collected long
sortField query name of field used to sort  
Response Body
media type data type description
application/json object (JSON) JSON Response with the list of versions and total number of versions

Example of response:

{"list":[{"parentVersionId":"1577", "versionId":"1792", "versionName":"Macro Test", "versionDescription":"revision: b2084150-dc31-47b7-9cb8-86719e73a997", "owner":"maz","ownerFullName":"Maciej Zabielski the user", "creationDate":"2016-11-09T15:29:22.859+01:00", "isDefault":true, "isSealed":true}], "total":1}

Example

Request
GET /api/av/history/json
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
...
                
              

DELETE /api/av/advanced/alternative/{alternativeId}

Delete given alternative (draft) by advanced version manager. Please note, that all versions in given alternative will be removed.

Request Parameters
name type description constraints
alternativeId path ID of alternative to be deleted long
Response Body
media type data type description
application/json HdcSuccessTO (JSON) JSON response with information if deleting was successful or not

Example

Request
DELETE /api/av/advanced/alternative/{alternativeId}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 204 No Content
Content-Type: application/json

                
{ }
                
              

PUT /api/av/advanced/alternative/{alternativeId}

Edit Name and Description of alternative (draft) by advanced archive manager.

Example of request:

{"alternativeName":"MyDraftName","alternativeDescription":"MyDraftDescription"}

Request Parameters
name type description constraints
alternativeId path Id of private draft which will be updated long
Request Body
media type data type
application/json HdcAlternativeTO (JSON)
Response Body
media type data type description
application/json HdcSuccessTO (JSON) JSON Response with information if update was successful or not

Example

Request
PUT /api/av/advanced/alternative/{alternativeId}
Content-Type: application/json
Accept: application/json

                
{ }
                
              
Response
HTTP/1.1 204 No Content
Content-Type: application/json

                
{ }
                
              

POST /api/av/advanced/publish/{alternativeId}

Publish given alternative (draft) on tip by advanced archive manager.

Request Parameters
name type description default constraints
alternativeId path ID of alternative to publish   long
async query indicates if request should be processed asynchronously false boolean
default query indicates if new version should be set as default for users false boolean
Response Body
media type data type description
application/json object (JSON) JSON Response with version information and information if publishing was successful or not, or information of publish process if async is true

Example

Request
POST /api/av/advanced/publish/{alternativeId}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 201 Created
Content-Type: application/json

                
...
                
              

PUT /api/av/alternative/rebase/{alternativeId}

Rebase alternative (draft) on top of Master Archive.

Request Parameters
name type description constraints
alternativeId path Id of private draft which will be updated long
Response Body
media type data type description
application/json HdcSuccessTO (JSON) JSON Response with information if update was successful or not

Example

Request
PUT /api/av/alternative/rebase/{alternativeId}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 204 No Content
Content-Type: application/json

                
{ }
                
              

GET /api/av/alternative/share/{alternativeId}

Get list of users or groups, which have right to access to given alternative (draft)

Request Parameters
name type description constraints
alternativeId path alternative ID long
mode query "?mode" - Could be users - get list of users or groups - get list of groups  
Response Body
media type data type description
application/json object (JSON) JSON Response with list of users

Example of response:

{"list":[{"id":2,"name":"user1","userFullName":"User 1","enabled":false,"email":""}]} or {"list":[{"id":22,"name":"Group C5","description":"Description of group C1","enabled":false}]}

Example

Request
GET /api/av/alternative/share/{alternativeId}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
...
                
              

POST /api/av/alternative/share/{alternativeId}

Share alternative (draft) with users or/and groups

Example of request:

{"list":[{"id":"userId"}]} or {"list":[{"id":"groupId"}]}

Request Parameters
name type description constraints
alternativeId path alternative to be shared long
Request Body
media type data type
application/json string (JSON)
Response Body
media type data type description
application/json HdcSuccessTO (JSON) JSON response with information if sharing was successful or not

Example

Request
POST /api/av/alternative/share/{alternativeId}
Content-Type: application/json
Accept: application/json

                
...
                
              
Response
HTTP/1.1 201 Created
Content-Type: application/json

                
{ }
                
              

POST /api/av/alternative/unshare/{alternativeId}

Unshare alternative (draft) with users or/and groups

Example of request:

{"list":[{"id":"userId"}]} or {"list":[{"id":"groupId"}]}

Request Parameters
name type description constraints
alternativeId path alternative ID to be unshared long
Request Body
media type data type
application/json string (JSON)
Response Body
media type data type description
application/json HdcSuccessTO (JSON) JSON response with information if sharing was successful or not

Example

Request
POST /api/av/alternative/unshare/{alternativeId}
Content-Type: application/json
Accept: application/json

                
...
                
              
Response
HTTP/1.1 201 Created
Content-Type: application/json

                
{ }
                
              

POST /api/av/alternative/version/{alternativeId}

Create version as a tip version (snapshot) of given alternative (draft)

Example of request:

{"versionName":"MyVersionName","versionDescription":"MyVersionDescription"}

Request Parameters
name type description constraints
alternativeId path ID of alternative long
Request Body
media type data type
application/json HdcVersionTO (JSON)
Response Body
media type data type description
application/json HdcSuccessTO (JSON) JSON Response with information if creation was successful or not

Example

Request
POST /api/av/alternative/version/{alternativeId}
Content-Type: application/json
Accept: application/json

                
{
  "description" : "...",
  "id" : 12345,
  "name" : "..."
}
                
              
Response
HTTP/1.1 201 Created
Content-Type: application/json

                
{ }
                
              

GET /api/av/history/json/{alternativeId}

Get list of versions (snapshots) in given alternative

Request Parameters
name type description constraints
alternativeId path ID of alternative to handle long
Response Body
media type data type description
application/json array of HdcVersionTO (JSON) JSON Response with the list of versions.

Example of response:

{"list":[{"parentVersionId":"20","versionId":"178663","versionName":"1b7f8cbb-e304-4db2-9540-2fbfa735cc46","owner":"ast","ownerFullName":"Artur Stepkowski","creationDate":"2013-10-18T11:20:43.696857+02:00"},{"parentVersionId":"178663","versionId":"178664","versionName":"df7277e0-82b6-464e-adb8-3957072fb09c","owner":"ast","ownerFullName":"Artur Stepkowski","creationDate":"2013-10-18T11:20:50.035078+02:00"}]}

Example

Request
GET /api/av/history/json/{alternativeId}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
[ {
  "description" : "...",
  "id" : 12345,
  "name" : "..."
} ]
                
              

PUT /api/av/history/json/{versionId}

Edit Name and Description of version (snapshot)

Example of request:

{"versionName":"MyVersionName","versionDescription":"MyVersionDescription"}

Request Parameters
name type description constraints
versionId path ID of version to handle long
Request Body
media type data type
application/json HdcVersionTO (JSON)
Response Body
media type data type description
application/json HdcSuccessTO (JSON) JSON Response with information if update was successful or not

Example

Request
PUT /api/av/history/json/{versionId}
Content-Type: application/json
Accept: application/json

                
{
  "description" : "...",
  "id" : 12345,
  "name" : "..."
}
                
              
Response
HTTP/1.1 204 No Content
Content-Type: application/json

                
{ }
                
              

GET /api/av/version/info/{versionId}

Request Parameters
name type description constraints
versionId path long
Response Body
media type data type description
application/json object (JSON)

Example

Request
GET /api/av/version/info/{versionId}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
...
                
              

PUT /api/av/advanced/alternative/rebase/{alternativeId}

Rebase alternative (draft) on top of Master Archive by advanced archive manager.

Request Parameters
name type description constraints
alternativeId path Id of draft which will be updated long
Response Body
media type data type description
application/json HdcSuccessTO (JSON) JSON Response with information if update was successful or not

Example

Request
PUT /api/av/advanced/alternative/rebase/{alternativeId}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 204 No Content
Content-Type: application/json

                
{ }
                
              

PUT /api/av/advanced/history/json/{versionId}

Edit Name and Description of version (snapshot) for advanced archive manager

Example of request:

{"versionName":"MyVersionName","versionDescription":"MyVersionDescription"}

Request Parameters
name type description constraints
versionId path ID of version to handle long
Request Body
media type data type
application/json HdcVersionTO (JSON)
Response Body
media type data type description
application/json HdcSuccessTO (JSON) JSON Response with information if update was successful or not

Example

Request
PUT /api/av/advanced/history/json/{versionId}
Content-Type: application/json
Accept: application/json

                
{
  "description" : "...",
  "id" : 12345,
  "name" : "..."
}
                
              
Response
HTTP/1.1 204 No Content
Content-Type: application/json

                
{ }
                
              

GET /api/av/advanced/tipversion/json/{alternativeId}

Get Tip Version for alternative

Request Parameters
name type description constraints
alternativeId path ID of alternative long
Response Body
media type data type description
application/json HdcVersionTO (JSON) JSON Response with the version ID.

Example of response:

{"versionId":"1"}

Example

Request
GET /api/av/advanced/tipversion/json/{alternativeId}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "description" : "...",
  "id" : 12345,
  "name" : "..."
}
                
              

PUT /api/av/advanced/version/setdefault/{versionId}

Set version as default for all users

Request Parameters
name type description constraints
versionId path ID of version to be set as default long
Response Body
media type data type description
application/json HdcVersionTO (JSON) JSON Response with new version context

Example of response:

{"alternative":{"owner":"admin","ownerFullName":"Administrator","alternativeId":"1","alternativeName":"main","alternativeDescription":"main version branch","rootVersionId":"1","tipVersionId":"4705","creationDate":"2014-10-02T15:52:09.892+02:00"},"parentVersionId":"4691","versionId":"4704","versionName":"test3","owner":"tom","ownerFullName":"Tomasz Wyczółkowski","creationDate":"2017-12-22T18:50:03.409+01:00","defaultVersionId":"4704","isSealed":true}

Example

Request
PUT /api/av/advanced/version/setdefault/{versionId}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 204 No Content
Content-Type: application/json

                
{
  "description" : "...",
  "id" : 12345,
  "name" : "..."
}
                
              

GET /api/av/object/history/json/{versionId}

Get Modified Objects History for following version

Request Parameters
name type description constraints
versionId path - version ID long
hqlCriteria query  
limit query - page limit long
masterVersion query - flag indicating if version is master version or draft (false) boolean
offset query - page offset long
sortField query - sort field  
Response Body
media type data type description
application/json object (JSON) JSON Response with the list of versions and total number of versions

Example of response:

{"total":12,"list":[{"operation":0,"hdid":1433,"classId":14234210,"source":14,"operationDate":"2015-05-11T07:39:27.007789Z","userId":144,"userName":"abc","userFullName":"abc","email":"abc@tessel.pl"},{"operation":0,"hdid":15,"classId":103,"source":14,"operationDate":"2015-06-11T13:29:55.948609Z","userId":144,"userName":"abc","userFullName":"abc","email":"abc@tessel.pl"}]}

Example

Request
GET /api/av/object/history/json/{versionId}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
...
                
              

GET /api/av/advanced/version/operations/json/{versionId}

Get last or all operations in given version

Request Parameters
name type description constraints
versionId path published version ID long
mode query set "?mode" to "all" or "last"  
Response Body
media type data type description
application/json object (JSON) JSON with list of operations

Example of response:

{"list":[{"userId":"9","timeStamp":"2013-10-22T15:27:31.475324+02:00","sourceId":"1","operationId":"i","objectId":"219895","objectClassId":"15","classId":"15"}]}

Example

Request
GET /api/av/advanced/version/operations/json/{versionId}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
...
                
              

POST /api/av/object/history/export/xls/{versionId}

Get Modified Objects History for following version in form of Excel report

Request Parameters
name type description default constraints
versionId path - version ID   long
hqlCriteria query    
masterVersion query - flag indicating if version is master version or draft (false) false boolean
sortField query - sort field    
Response Body
media type data type description
application/json HdcPathProcessStateTO (JSON) JSON Response with the list of versions and total number of versions

Example

Request
POST /api/av/object/history/export/xls/{versionId}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 201 Created
Content-Type: application/json

                
{ }