This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com

Home

 
4D v19
Web/REST Resource

Web/REST Resource  


 

 

This page contains the options used to enable and control REST access for the 4D database.

REST allows external applications to access the data of your database directly, for example through Open datastore feature.  

Note: 

  • on 4D Server, opening a REST session requires that a free 4D client licence is available.
  • on 4D single-user, you can open up to three REST sessions for testing purposes. 

For security reasons, by default, 4D does not respond to REST requests. If you want to use this functionality, you must check the Expose as REST server option in order for REST requests to be processed. 

Note: REST services use the 4D HTTP server, so you need to make sure that the 4D Web server is started.

The warning message "Caution, check the access privileges" is displayed when you check this option to draw your attention to the fact that when REST services are activated, by default access to database objects is free as long as the REST accesses have not been configured.

Access  

This option specifies a group of 4D users that is authorized to establish the link to the 4D database using REST queries. 

By default, the menu displays <Anyone>, which means that REST accesses are open to all users.
Once you have specified a group, only a 4D user account that belongs to this group may be used to access 4D by means of a REST request -- in particular, to open a session using the Open datastore command. If an account is used that does not belong to this group, 4D returns an authentication error to the sender of the request. 

Note that in order for this setting to take effect, the On REST Authentication database method must not be defined. If it exists, 4D ignores access settings defined in the Database Settings,

Warning: Since any REST request requires a session and thus a valid license, it is recommended to filter requests by either assigning a 4D user group to REST access, or by using the On REST Authentication database method. Otherwise, the server will create a session for every incoming REST request (even $info) and take a license. When an incoming REST request is linked to an existing user session (created through a previous authentication), 4D will reuse the same session.

 
PROPERTIES 

Product: 4D
Theme: Database Settings

 
PAGE CONTENTS 
 
HISTORY 

 
TAGS 

REST

 
ARTICLE USAGE

4D Design Reference ( 4D v19)