Best practice end points for "My environments"

Novulo REST End points in the integrated application allow for easy-to-configure access in sales to create “my” environments.

To authenticate the Website user, please refer to REST API calls and authorization - #3 by Joost to know how to ensure the %website_user parameter.

For the set-up of end points, we recommend the following structure:

/rest/app_name/customers/{customer_id}

/rest/app_name/customers/{customer_id}/sales?page=1
/rest/app_name/customers/{customer_id}/sales/{sales_id}

/rest/app_name/customers/{customer_id}/invoices?page=1
/rest/app_name/customers/{customer_id}/invoices/{invoice_id}

/rest/app_name/customers/{customer_id}/deliveries?page=1
/rest/app_name/customers/{customer_id}/deliveries/{delivery_id}

Which this set-up, you can define the end points using Path-parameters.
This set-up requires 7 REST End points, using 4 Data definitions using a show_details-parameter.

For example, for saless, you typically set-up one Data definition on sales. (which can have sub data definitions, like saleslines or activities).

The sales data definition will feature fields like ID, description and date, which are always part of the object.
Details including sales lines and other details, are only shown when you have show_details=true. This way of working ensures that the object is always managed in one place.

For ‘my’ end points that have saless with hundreds of lines per sales, you might choose to also add a paginated end point like:

/rest/app_name/customers/{customer_id}/sales/{sales_id}/saleslines
4 Likes

This looks beautiful! I tried to use it but I was not able to put the inputparameter in the middle of my URL. Is there an example of the syntax used, both in the URL placeholder and in the REST end point in Novulo?

Hi Mila,
In the path, you enter it as in the example, with the parameter name between the {curly brackets}.

Then, register the parameter at the REST Parameters. Here, you need to specify it’s a URL parameter. Then, it works in your end point and data definition just like query parameters.

1 Like