Page 1 of 3

Need Help! REST APIs Using API Express

Posted: Wed Jun 17, 2015 11:38 pm
by Blair Cox

I've spent the entire day reading and trying to figure this out. I've solved a lot of my issues - mostly thank to this video (https://blog.appery.io/2015/06/video-...)

But I'm desperately stuck and need help please!

Using the API Express features, I've setup a connection to my MySQL DB. No Problem. I have the API working, no problem.

But for the life of me, cannot get the where query to work! Nothing I've read and tried has worked.

How can I pass the 'where' variable back in the request as is shown in the documentation??

https://appery.io/apiexpress-api/rest...

Tried this too - just throws an error:

You can also test the service; open the service and switch to the Test tab. Paste the following for the where parameter:

{"States":{"$regex":"C", "$options":"i"}}
Click “Test.”

The above will return all states that start with letter C or c. “$options”:”i” is what specifies the query to ignore the case.

Please help :)


Need Help! REST APIs Using API Express

Posted: Wed Jun 17, 2015 11:49 pm
by Blair Cox

So what I need to be able to do, is choose which data entries to display based on a criteria.

For example, show all entries that contain 'Beef' in a table column. I've been following the examples, but I cannot seem to get regex to work - eeeeek

Seems so simple, but I'm not getting it :(


Need Help! REST APIs Using API Express

Posted: Wed Jun 17, 2015 11:58 pm
by Blair Cox

uggghhhh, after 10 hours of reading and effort, FINALLY found the answers here!!

https://www.youtube.com/watch?v=KeDz6...

sigh....


Need Help! REST APIs Using API Express

Posted: Thu Jun 18, 2015 12:11 am
by Blair Cox

my god, this is enough to drive you insane... still doesn't work!

Test custom service

URL
https://appery.io/apiexpress-api/rest..........

SELECT * FROM Business_Info WHERE contact_name = :name

Name: Business_Info/{name}

Image


Need Help! REST APIs Using API Express

Posted: Thu Jun 18, 2015 12:22 am
by Blair Cox

This SQL works in my MySQL DB:

SELECT * FROM 'Business_Info' WHERE 'contact_name'= "Blair"

How do I translate this to work with Appery?

This is the example from the video - what am I doing wrong?????

Image


Need Help! REST APIs Using API Express

Posted: Thu Jun 18, 2015 12:26 am
by Blair Cox

Trying these SQL statements results in the same error:

// add sql
//SELECT * FROM Business_Info WHERE contact_name = :name
//SELECT * FROM 'Business_Info' WHERE 'contact_name'= ":name"
//SELECT * FROM 'Business_Info' WHERE 'contact_name'= "name"
SELECT * FROM 'Business_Info' WHERE 'contact_name'= :name

{
"code": "MS009",
"message": "Incorrect server configuration",
"status": "INTERNAL_SERVER_ERROR"
}


Need Help! REST APIs Using API Express

Posted: Thu Jul 02, 2015 1:58 pm
by Alena Prykhodko

Hello Blair,

Try this syntax:

preSELECT * FROM Business_Info WHERE contact_name = :?name /pre

Note, should be like precontact_name = :?name /pre


Need Help! REST APIs Using API Express

Posted: Wed Aug 05, 2015 12:46 am
by Andrew Main

I'm having the exact same issue. the automatically generated ones work just fine. However in my custom service named, "blocks/{id}"

SQL:
select * from blocks where id = :id

returns:
{
"code": "AE009",
"message": "Incorrect server configuration",
"status": "INTERNAL_SERVER_ERROR"
}

and SQL:
select * from blocks where id = :?id

during testing returns:
{
"code": "AE000",
"message": "Operation can not be performed",
"status": "INTERNAL_SERVER_ERROR"
}

My issue is i'm trying to apply some sort of sorting and the default Find service doesn't seem to like any where parameters such as {"id":{"$gt":4}} That gives me an error:
{
"code": "AE007",
"message": "Value for field id should be NUMBER",
"status": "BAD_REQUEST"
}

I feel like i'm doing something wrong, have spent hours looking at videos and the dev centers and can't seem to make it work.


Need Help! REST APIs Using API Express

Posted: Thu Sep 24, 2015 11:19 am
by Tavonia Evans

This doesn't seem to work at all for SQL


Need Help! REST APIs Using API Express

Posted: Thu Sep 24, 2015 11:24 am
by Tavonia Evans

I keep getting those error codes over and over