The API URL

The API URL
calac41
REST is usually an HTTP-based protocol. This article describes how the URL for your API is constructed.
The following code snippet shows a typical REST URL for your API:
[http: || https]://[server.company.com[:port[/ServerWAR]] ]/rest/[TeamSpace name]/[URL fragment]/[api version]/request
 
Service
The leading portion of the URL locates the server.
If you have installed the single-user demonstration package of 
CA Live API Creator
 that is based on Jetty (demonstration package), use a URL similar to the following:
http://localhost:8080/rest/default/demo/v1/Customers/123
If you have a API developer or production installation, use a URL similar to the following:
https://server.acme.com/rest/default/demo/v1/Customers/123
Depending on the options that you have defined for your API, you might not be required to use HTTPs as the protocol.
TeamSpace/Project
The TeamSpace/project portion of the URL is the name of your TeamSpace and the URL for your API. 
CA Live API Creator
 creates these when you install 
CA Live API Creator
 and when you create an API. API names must be unique within your TeamSpace.
For more information about the URL for your API, see API Properties.
API Version/Request
The last portion of the URL reflects the request you are coding. The first part is the name of the API version you are targeting.
Your code might create a prefix for the service/project portion to be pre-pended to the request.
 
Best practice: 
To facilitate controlled migration over revisions, do not hard-code the API version into the URL.
For other best practices, see API Design Best Practices.
The second part of the URL is the request. This is your resource name, followed by parameters (for example, the primary key, filters, and ordering). Your resource name is either a base table or a resource that you explicitly defined in API Creator. You can access contained resources (for example, 
OneCustomer.Orders
) by specifying resource names with dot notation.
For example, to read the 
Purchase Order
 table in the Demo API sample, using the 
v1
 API version:
http://localhost:8080/rest/default/demo/v1/demo:PurchaseOrder/1
For more information about how to manage API versions, see API Versions.