Creating jobs
To kick-start the analysis process, you can directly call our Analysis API endpoint using a POST request on:
Request Method: POST
https://api.enablenow.nl/cfa/analysis-jobs
Creating an analysis-job can be done in a few different ways:
- Consent-based
- User-based (by UserId)
- Account-based
- Analysis-based (an existing analysis)
Here's a brief walkthrough on how to initiate jobs with the mentioned API endpoint:
Request - using ConsentId
You can start an analysis job by supplying one of more consentIds. This value is associated with the user's consent received from the AppScreen.
For instance, if the consentId is af86536d-34e3-4ebc-6c64-08db56ccef25, you would create a POST request to:
Request Method: POST
https://api.enablenow.nl/cfa/analysis-jobs// application/json request body
{
"Reference" : "Analysis with ConsentId",
"Engine" : "z2",
"Profile" : "retail",
"Input" : {
"consentIds" : [ "af86536d-34e3-4ebc-6c64-08db56ccef25" ]
}
}
If you want to run the analysis with more than one consentId, you only need to change the line shown below:
// application/json request body
{
...
"Input" : {
"consentIds" : [ "af86536d-34e3-4ebc-6c64-08db56ccef25", "3813607a-1cab-4094-8483-0a15c71600aa" ]
}
...
}
Request - using UserId
You can start an analysis job by supplying one of more userIds. This value is the EnableNow user identifier.
For instance, if the userId is 6a8cf3ee-e416-4920-b696-2c9de18f5346, you would create a POST request to:
Request Method: POST
https://api.enablenow.nl/cfa/analysis-jobs// application/json request body
{
"Reference" : "Analysis with UserId",
"Engine" : "z2",
"Profile" : "corporate",
"Input" : {
"userIds" : [ "6a8cf3ee-e416-4920-b696-2c9de18f5346" ]
},
"Metadata" : {
"kvk_number" : "12345678"
}
}
Please note that in this example, the Profile used changed to corporate which requires that also the Metadata field with a valid KvK (Chamber of Commerce) registration number.
If you want to run the analysis with more than one userId, you only need to change the line shown below:
// application/json request body
{
...
"Input" : {
"userIds" : [ "6a8cf3ee-e416-4920-b696-2c9de18f5346", "a9effcf4-2fe5-4485-a2c5-5f2e4f026dc1" ]
}
...
}
Request - using AccountId
You can start an analysis job by supplying one of more accountIds. This value is the EnableNow account identifier.
For instance, if the accountId is 8eada786-3057-42bd-833f-f161e24fecba, you would create a POST request to:
Request Method: POST
https://api.enablenow.nl/cfa/analysis-jobs// application/json request body
{
"Reference" : "Analysis with AccountId",
"Engine" : "z2",
"Profile" : "retail",
"Input" : {
"accountIds" : [ "8eada786-3057-42bd-833f-f161e24fecba" ]
}
}
If you want to run the analysis with more than one accountId, you only need to change the line shown below:
// application/json request body
{
...
"Input" : {
"accountIds" : [ "8eada786-3057-42bd-833f-f161e24fecba", "2f168cc2-4423-4f14-8126-dd8373c758c3" ]
}
...
}
Request - using AnalysisJobId
You can start an analysis job by supplying one of more analysisJobIds. This value is the EnableNow analysis job identifier. This means that the identifiers must exist already and be assigned to previously executed analysis jobs.
For instance, if the analysisJobId is 9e8e684d-3fb4-4a99-b97f-586aaa8432f7, you would create a POST request to:
Request Method: POST
https://api.enablenow.nl/cfa/analysis-jobs// application/json request body
{
"Reference" : "Analysis with AnalysisJobId",
"Engine" : "z2",
"Profile" : "retail",
"Input" : {
"analysisJobIds" : [ "9e8e684d-3fb4-4a99-b97f-586aaa8432f7" ]
}
}
If you want to run the analysis with more than one analysisJobId, you only need to change the line shown below:
// application/json request body
{
...
"Input" : {
"analysisJobIds" : [ "9e8e684d-3fb4-4a99-b97f-586aaa8432f7", "5400b184-fe6e-4690-b45c-17590226f499" ]
}
...
}
Response
All the requests above return the same response: an unique analysis job identifier.
Example
{
"id": "4e0551fc-33a5-4f20-83fb-96c2d79979a2"
}
You can use the monitoring endpoints from the API to get information about the analysis job and check its status by using this identifier as detailed in the next chapter.