cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

readEntityData() is not getting called in a custom GET API

PJ_9888086
6-Contributor

readEntityData() is not getting called in a custom GET API

I am writing a rest service to get users based on a filter. Along with filter I need to fetch the users based on some conditions, and hence need to write a custom hook.

 

Following is my JSON:

 

ContextCreations.json

 

 

{
"name": "ContextCreation",
"collectionName": "ContextCreations",
"type": "wcType",
"wcType": "wt.org.WTUser",
"description": "get Users",
"operations": "READ",
"attributes": [
{
"name": "Name",
"internalName": "name",
"type": "String"
},
{
"name": "FullName",
"internalName": "fullName",
"type":"String"
},
{
"name":"Email",
"internalName":"eMail",
"type":"String"
}
],
"actions": [],
"navigations": []
}

 

 

 

Following is the .js file (ContextCreations.js)

 

 

 

function readEntityData(processorData){
var customAPI= Java.type('ext.api.CustomAPI');
customAPI.test();
}

 

 

 

We have configured custom domain and its working fine as other POST APIs are working fine. I am calling the above code with http GET and the readEntityData() never gets called. I've a sysout in the customAPI.test() and it doesn't appear in the MS logs. If I call .test() method any other existing post API then I do see the sysout.

 

Shouldn't readEntityData() gets called automatically? Do I need to call it explicitly in my GET call? 

0 REPLIES 0
Top Tags