Using the TDM API to call a Specific Flow

Document ID : KB000100463
Last Modified Date : 07/06/2018
Show Technical Document Details
Issue:
Can you provide a walk through on how to write the correct TDM API call to call a specific flow. I don't have too much experience with API's as it is, but need help understanding the TDM APIs in particular.  can you provide an example workflow?
Environment:
TDM 4.5
Resolution:
Here is a workflow that shows how and what to populate.  Please notice that CURL is also used.

{
"name":"Publish_travel_Add People",
"description":"Publish to travel using Add People", "projectId":2200, "type":"PUBLISHJOB", "origin":"generation", "scheduledTime":"2018-05-23T09:11:00Z",
"email":"brian.weissman@ca.com",
"jobs":[
],
"parameters":{
"variableDefaults":[],
"generatorId":2211,
"jobType":"PUBLISH",
"title":"Publish to travel using Add People", "publishTo":"TGT", "target":"dbo", "actionOnDuplicate":"exit", "actionOnGenDuplicate":"exit", "dataTargetProfile":"travel",
"dataSourceProfile":"travel", "repeatCount":10, "tables":[ { "tableNo":36, "tableName":"PEOPLE",
"status":1
},
{ "tableNo":42,
"tableName":"CREDIT_CARDS",
"status":1
}
],
"email":"brian.weissman@ca.com"
}
}

CURL:
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJBZG1pbmlzdHJhdG9yIiwiYXVkIjoiQUxMIiwiUFdEX0hBU0hfQ0xBSU0iOiI4MzkzMTQyODMiLCJpc3MiOiJDQSBUZWNobm9sb2dpZXMiLCJVU0VSX0lEIjoiMSIsImV4cCI6MTUyNzE2NTkxNSwiaWF0IjoxNTI3MDc5NTE1LCJBQ0NFU1NfUEVSTUlTU0lPTlMiOiJ7XCJBTExfUFJPSkVDVFNcIjpbMTAwXX0ifQ.KUcG5-mMcKiNaoMtZbTkhhTzJAs1wzcwd2HWPNyiSvM' -d '{ \
"name":"Publish_travel_Add People", \
"description":"Publish to travel using Add People", \
"projectId":2200, \
"type":"PUBLISHJOB", \
"origin":"generation", \
"scheduledTime":"2018-05-23T09:11:00Z", \
"email":"brian.weissman%40ca.com", \
"jobs":[ \
], \
"parameters":{ \
"variableDefaults":[], \
"generatorId":2211, \
"jobType":"PUBLISH", \
"title":"Publish to travel using Add People", \
"publishTo":"TGT", \
"target":"dbo", \
"actionOnDuplicate":"exit", \
"actionOnGenDuplicate":"exit", \
"dataTargetProfile":"travel", \
"dataSourceProfile":"travel", \
"repeatCount":10, \
"tables":[ \
{ \
"tableNo":36, \
"tableName":"PEOPLE", \
"status":1 \
}, \
{ \
"tableNo":42, \
"tableName":"CREDIT_CARDS", \
"status":1 \
} \
], \
"email":"brian.weissman%40ca.com" \
} \
}' 'https://localhost:8443/TDMJobService/api/ca/v1/jobs'

Request URL: https://localhost:8443/TDMJobService/api/ca/v1/jobs

Headers:
{ "Accept": "application/json",
"Authorization": "Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJBZG1pbmlzdHJhdG9yIiwiYXVkIjoiQUxMIiwiUFdEX0hBU0hfQ0xBSU0iOiI4MzkzMTQyODMiLCJpc3MiOiJDQSBUZWNobm9sb2dpZXMiLCJVU0VSX0lEIjoiMSIsImV4cCI6MTUyNzE2NTkxNSwiaWF0IjoxNTI3MDc5NTE1LCJBQ0NFU1NfUEVSTUlTU0lPTlMiOiJ7XCJBTExfUFJPSkVDVFNcIjpbMTAwXX0ifQ.KUcG5-mMcKiNaoMtZbTkhhTzJAs1wzcwd2HWPNyiSvM"
}

From this, the Client created their own successful API call.  Please note that the Client removed all Sensitive information, but wanted to show how they adopted the above for their environment:

POST /request https://
Authorization: Bearer {{BearerToken}}
Accept: application/json
Host: 
Content-Type: application/json

{
    "jobPubParams":{
        "almjobs":[],
        "rallyJobs":[],
        "jobParams":[],
        "publishJobs":[{
            "batchEngineThread":"ANY",
            "dataSourceProfile":"",
            "dataTargetProfile":"",
            "description":"",
            "jobTitle":"Group Job",
            "levelID":,
            "publishVariables":[{
                "name":"",
                "preResolveError":"",
                "preResolveValue":"",
                "value":"1"
            }],
            "seq":1,
            "vtfnodeID":"",
            "vtfnodeName":"",
            "iterations":1,
            "defaultPublishID":
        },{
            "batchEngineThread":"ANY",
            "dataSourceProfile":"",
            "dataTargetProfile":"",
            "description":"",
            "jobTitle":"Group Job",
            "levelID":,
            "publishVariables":[{
                "name":"",
                "preResolveError":"",
                "preResolveValue":"",
                "value":""
            }],
            "seq":,
            "vtfnodeID":"",
            "vtfnodeName":"",
            "iterations":1,
            "defaultPublishID":
        }],
        "testMatches":[],
        "exportJobs":[],
        "selfServiceEmailMandate":false,
        "email":"",
        "globalThreadName":"ANY",
        "scheduledDateTimeInMillisec":"1995-05-03T00:00:00.000Z",
        "scheduledDateTimeInMillis":1527795089764,
        "currentDay":"{{Day}}",
        "currentMonth":"{{Month}}",
        "currentYear":"{{Year}}",
        "globalSourceConnection":"",
        "globalTargetConnection":"",
        "jobSubmissionOrder":"0",
        "jobTitle":"",
        "username":""
    },
    "advancedToggleFlag":true,
    "dataDesign":{
        "projectID":,
        "versionID":
    }
}
Additional Information:

Video URL on how to open a Support Case - https://communities.ca.com/videos/5898-demo-how-to-open-a-support-case

You can download the latest version of TDM by following the directions in this document: https://support.ca.com/us/knowledge-base-articles.TEC1903942.html.   

To contact support, go to https://www.ca.com/us/services-support/ca-support/contact-support.html