Quantcast
Channel: DreamFactory Forum - Latest topics
Viewing all articles
Browse latest Browse all 1523

Calling another endpoint from a custom script

$
0
0

@gnl wrote:

Hi,

I've been trying to call another endpoint in DF 2.6 through a custom V8js script and I just can't!

I've followed @drewpearce article on https://dzone.com/articles/database-table-endpoint-obfuscation-through-custom but it just doesn't work. The roles are all set up with proper script access. Also the call is being made with an authenticated and authorized user.

the code that I currently have is :

var id = platform.session.user.id;

var api_path = '/padb/_proc/list_user_messages'; 
var options = {}; 
options.parameters = event.request.parameters; 
options.parameters.in_id = id;
options.headers = event.request.headers;
var result;
result = platform.api.get(api_path, null, options);

var_dump(result);

also I tried with

result = platform.api.get(api_path, options);

but still doesn't work.

the logs don't show anything apart from "NULL" for the result dump.

If I call the list_user_messages directly it works but not through the proxy endpoint.

Any ideas or suggestions?

Thanks,
George

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 1523

Trending Articles