Hi,
I’m trying to create a very simple REST method which generates an identifier in a particular format, ready for use in an external app which doesn’t provide sufficient development capability to generate the ID.
I’ve set up a custom event ‘generateuuid’ and download the PHP code. I’ve then added the code to generate the ID and return it.
Coderunning is running, and got to the [INFO] Waiting for events line.The event is showing the “debug” part of the console.
I’ve tried calling the service via POST to
https://api.backendless.com/v1.0/servercode/events/generateuuid
with the app id and secret key the header.
But all backendless returns is a HTML page with “Action not found” on it.
Any idea what I’m doing wrong?
Regards,
Andy
Hi Andy,
is the Content-type of the request “application/json” ?
What does the request body look like?
Regards,
Mark
Hi Mark,
Thanks for the quick response. The request body is empty, as the service will just return a unique ID. I did not have content-type defined, but I’ve set up to application/json and it’s made no difference.
Andy
Hi Andy,
Could you try sending an empty JSON object in the body? That is “{}”
Here’s a sample curl request that should trigger your event (make sure to substitute YOURAPPID and YOURRESTKEY values):
curl -H application-id:YOURAPPID -H secret-key:YOURRESTKEY -H application-type:REST -H Content-Type:application/json -X POST -d '{}' -v http://api.backendless.com/v1/servercode/events/generateuuid
Regards,
Mark
HI Mark,
Oh, my apologies. I had v1.0 in the url, not v1.
However, now I’ve fixed that, I’m getting timeout issues. I’ll re-read the tutorials on coderunner in case I’ve missed something, and will open a new topic if I still have problems.
But I do have one question: I saw a post by someone else in your company who said, 2 weeks ago, that php custom code was not production-ready yet, and wouldn’t be for about a month (at that point). Does that still apply?
Regards,
Andy
Hi Andy,
We are very close to getting it ready in production as well. Our goal was to release the production support in March and it looks very likely we will stick to the schedule.
I will mark this topic as “Answered”. Please open a new one if the timeout problem is not resolved.
Regards,
Mark