Group Abstract Group Abstract

Message Boards Message Boards

Issues with Wolfram API to call another API

Posted 9 years ago

Hi, all. I've posted this question in the Mathematica StackExchange group, but I figured some might be interested/able to help so posting it here as well seemed like a good idea:

I've built a set of Wolfram APIs that call another API which builds specific queries given the parameters of a database and then outputs that query for the client in the appropriate query language syntax. Using URLExecute in the Mathematica notebook on the database URL itself works just fine, but the issue comes when trying to call the database API, and the issue has been narrowed down to the use of URLExecute in the body of APIFunction, which looks something like this:

APIFunction[{
"string1" -> "String",
"string2" -> "String"},
URLExecute[
 "http://path-to-database",
{
"format" -> "json",
"query" -> QueryBuilder[#string1, #string2]
},
"Method" -> "POST"] &]

When deploying the API to the cloud, the error message given was some kind of permission/configuration error. My question is, is there a way to work around this? Or is this pushing past the limits of the Wolfram Cloud capabilities? Was the Wolfram Cloud designed to handle these sorts of interactions? Some feedback would be awesome, because otherwise I think I've reached an indefinite roadblock with what I'm trying to do.

If this info helps, the permissions of the database cloud server is set to allow anyone to call information from it, and the permissions of the Wolfram Cloud server are set to public.

POSTED BY: Jesse Dohmann
8 Replies

It may well be quite easy to do what you are trying to do. To quickly find out if this is so, provide a URLExecute that demonstrates a successful API call from a Mathematica notebook to the Neo4j 7-Day Sandbox. Please also mention any required setup details for the sandbox.

Sorry if my reading comprehensions skills are failing, but are you saying that when you call CloudDeploy with an api function like the one you show that it fails or are you saying that when you try to call the api you successfully deployed you get an error result returned from URLExecute? Does the URLExecute call work from a notebook that you are running in the cloud? If you could include the actual failure result (the message or unexpected data) that would be helpful too.

POSTED BY: Andrew de Laix
Posted 9 years ago

Hi, Andrew. No worries, thanks for giving me the opportunity to clarify: URLExecute does work when calling in the cloud notebook, but cloud deployment with URLExecute in the body of APIFunction, such as the one above, fails. I've been trying to replicate the error result I got the first time, but now I'm just getting time out errors; the original error message said it was a configuration connection error. I don't really understand how Wolfram API is interacting with the database API to give you a more detailed answer.

POSTED BY: Jesse Dohmann
POSTED BY: Andrew de Laix
Posted 9 years ago
POSTED BY: Jesse Dohmann
POSTED BY: Andrew de Laix
Posted 9 years ago

Do you have a specific error message or any information on the external API (e.g. link to documentation)?

POSTED BY: Joel Klein
Posted 9 years ago
POSTED BY: Jesse Dohmann
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard