Please enable JavaScript to view this site.

Navigation: Advanced topics > Programming topics > PHPRunner's REST API

About REST API

Scroll Prev Next More

As a first step enable REST API under Miscellaneous->REST API. Then configure REST API security to make sure your data is protected.

 

rest_api_security

REST API methods

 

 

Method

Description

list

Returns a set of records

view

Returns single record data

update

Updates a record

insert

Adds a new record

delete

Deletes a record

sendError()

Sends the error message back to caller

inRestApi()

Tells if the current request is executed as a part of REST API call

REST API Events

Since REST API interaction is fully UI-less, not all events make sense. Here is the list of events that will be executed for requests made via REST API:

 

AfterAppInitialized

AfterTableInitialized

BeforeAdd/AfterAdd

BeforeEdit/AfterEdit

Before record deleted

After record deleted

REST API Authorization

Skip this section if your project doesn't have the login page enabled.

REST API Considerations

URLs

URLs and URL parameters should be URL encoded. For instance instead of "order details" you need to use "order%20details".

 

This is correct:

 

 

curl "http://localhost:8086/api/v1.php?table=order%20details&action=view&editid1=10248&editid2=42"  

And this is not:

 

curl "http://localhost:8086/api/v1.php?table=order details&action=view&editid1=10248&editid2=42"  

And response will be:

 

{  
error: "Unknown table name",  
success: false  
}

 

List of fields

For now, all fields that appear in the SQL query will be returned in case of list/view or updated in case of update/insert. Later we will have an additional option to choose fields that are updatable or selectable via REST API.

 

Files upload

Not yet supported.

 

Advanced Security

If Advanced Security mode like "Users can see and edit their own data only" is enabled in PHPRunner it will be also applied to the REST API requests.

 

 

Created with Help+Manual 7 and styled with Premium Pack Version 3 © by EC Software