- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I wanted to use the datahub api to get a related column from a related entity (Claim) and make it a part of the workflow of my Case entity so I can make API calls to external tools and apps.
Using the task script :
var caseRelationshipsJson = doGet("/svi-datahub/links?_relationshipName=Sinistre&_fromEntityTypeName=Dossier&_entityTypeName=Dossier&_entityId=" + svi_dossier_id ); var caseRelationItems=caseRelationshipsJson.items; var ID_sin = caseRelationItems[1].toObjectId execution.setVariable("ID_SINISTRE", ID_sin);
I have no idea why this does not work or how to debug it.
Does doGet() use the authetification of the session or should I add a relative authetification token to that if so how to ?
Thanks in advance.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your reactivity.
This was the solution:
The authorization token when using the REST service task will be be included in the header automaticaly.
URL:
/svi-datahub/links_relationshipName=Sinistre&_fromEntityTypeName=Dossier&_entityTypeName=Dossier&_entityId={copied ID into workflow variable}
in the REST URL.
Then save the response based on JSON fields to workflow variables.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi iakrim,
Which version of Visual Investigator are you running?
svi-datahub-service logs would be a good place to start with, which would contain the error, if there is one. I managed to reproduce the error you are seeing and it suggests doGet() function does not exist.
Cheers,
Paulius Peciura.
Register today and join us virtually on June 16!
sasglobalforum.com | #SASGF
View now: on-demand content for SAS users
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi Thanks for the reply.
I'm on
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi iakrim,
You are welcome. Did svi-datahub-service logs provide you some information in order to debug the issue further?
I was about to suggest that perhaps a REST Service task will be easier to implement. It can issue an authenticated request, parse the response body and write the values from the response into a workflow variable.
Cheers,
Paulius Peciura.
Register today and join us virtually on June 16!
sasglobalforum.com | #SASGF
View now: on-demand content for SAS users
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
To give you more context I have created 2 api clients (1st one I use it to automate incremental indexation and the 2nd one I wanted it for the workflow related objects calls).
Attacked you will find the two responses I get using an API client. And what happends if the same example is called from the browser via session credentials :
1 st client used for Auto Index
2nd client created following the SAS guide on github page : https://github.com/sassoftware/devsascom-rest-api-samples/blob/master/CoreServices/sasLogon.md
The expected response like what happends when showing the same example:
Thanks for your time
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I was made aware of a Technical Support track raised for the same issue which has now been resolved.
Cheers,
Paulius Peciura.
Register today and join us virtually on June 16!
sasglobalforum.com | #SASGF
View now: on-demand content for SAS users
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your reactivity.
This was the solution:
The authorization token when using the REST service task will be be included in the header automaticaly.
URL:
/svi-datahub/links_relationshipName=Sinistre&_fromEntityTypeName=Dossier&_entityTypeName=Dossier&_entityId={copied ID into workflow variable}
in the REST URL.
Then save the response based on JSON fields to workflow variables.