Podcast
Questions and Answers
What architecture does the Optimizely Configured Commerce Admin Console employ for improved performance?
What architecture does the Optimizely Configured Commerce Admin Console employ for improved performance?
Which method is used to generate OData controllers in Configured Commerce?
Which method is used to generate OData controllers in Configured Commerce?
Which property setting archives a product entity in Configured Commerce?
Which property setting archives a product entity in Configured Commerce?
How is the Admin API for retrieving archived entities accessed?
How is the Admin API for retrieving archived entities accessed?
Signup and view all the answers
Which third-party tool can be used to build and consume APIs effectively?
Which third-party tool can be used to build and consume APIs effectively?
Signup and view all the answers
What is true about the archiving of entities in Configured Commerce?
What is true about the archiving of entities in Configured Commerce?
Signup and view all the answers
Where are the querying, updating, and deleting operations located in Configured Commerce?
Where are the querying, updating, and deleting operations located in Configured Commerce?
Signup and view all the answers
What attribute is used in the Admin API for authentication when consuming Storefront REST APIs?
What attribute is used in the Admin API for authentication when consuming Storefront REST APIs?
Signup and view all the answers
What is the purpose of the refresh token in the authorization process?
What is the purpose of the refresh token in the authorization process?
Signup and view all the answers
What happens when an API call is made with an expired bearer token?
What happens when an API call is made with an expired bearer token?
Signup and view all the answers
Which of the following keys should be included in the body when requesting a new bearer token?
Which of the following keys should be included in the body when requesting a new bearer token?
Signup and view all the answers
What is the scope needed to access the Admin API?
What is the scope needed to access the Admin API?
Signup and view all the answers
Where is the refresh token stored after it is received?
Where is the refresh token stored after it is received?
Signup and view all the answers
What should be done to consume the Admin REST API?
What should be done to consume the Admin REST API?
Signup and view all the answers
Which HTTP verb is used to create a new object in the Admin API?
Which HTTP verb is used to create a new object in the Admin API?
Signup and view all the answers
What is the difference in credential requirements between the Admin API and regular user access?
What is the difference in credential requirements between the Admin API and regular user access?
Signup and view all the answers
Which type of authentication is used for the Admin API?
Which type of authentication is used for the Admin API?
Signup and view all the answers
What is the URL prefix for accessing Admin API endpoints?
What is the URL prefix for accessing Admin API endpoints?
Signup and view all the answers
What operation is performed by the HTTP verb PATCH in the Admin API?
What operation is performed by the HTTP verb PATCH in the Admin API?
Signup and view all the answers
Which of the following operations will retrieve a single object using its Unique Id?
Which of the following operations will retrieve a single object using its Unique Id?
Signup and view all the answers
What is the purpose of the GET entity/Default.Default() operation?
What is the purpose of the GET entity/Default.Default() operation?
Signup and view all the answers
Which HTTP verb is NOT used for object retrieval in the Admin API?
Which HTTP verb is NOT used for object retrieval in the Admin API?
Signup and view all the answers
Which API endpoint retrieves the value of a single custom property on an object?
Which API endpoint retrieves the value of a single custom property on an object?
Signup and view all the answers
What happens when the DELETE entity({id}) operation is performed?
What happens when the DELETE entity({id}) operation is performed?
Signup and view all the answers
What is the maximum number of results that can be returned in a single Admin API request?
What is the maximum number of results that can be returned in a single Admin API request?
Signup and view all the answers
Which syntax is used to retrieve a single product via the Admin API?
Which syntax is used to retrieve a single product via the Admin API?
Signup and view all the answers
How can a child collection be retrieved using the Admin API?
How can a child collection be retrieved using the Admin API?
Signup and view all the answers
What format is used to update an entity's 'isActive' property in the Admin API?
What format is used to update an entity's 'isActive' property in the Admin API?
Signup and view all the answers
Which library replaced the Insite.Model library in Configured Commerce?
Which library replaced the Insite.Model library in Configured Commerce?
Signup and view all the answers
What is a key characteristic of the entities in the Insite.Data.Entities library?
What is a key characteristic of the entities in the Insite.Data.Entities library?
Signup and view all the answers
What token must be included in the request header to perform updates using the Admin API?
What token must be included in the request header to perform updates using the Admin API?
Signup and view all the answers
What does the OData.NextLink typically contain when retrieving results?
What does the OData.NextLink typically contain when retrieving results?
Signup and view all the answers
Study Notes
Configured Commerce Admin API Overview
- The Optimizely Configured Commerce Admin Console has a modularized software architecture for performance, upgrades, and integration.
- Each module communicates using RESTful APIs enabling third-party applications to interact with administration data.
- You can view and test endpoints using the OpenAPI Specification (aka Swagger) at [YOUR_WEBSITE_URL]/swagger.
Admin API Architecture Details
- Entity Framework Code First version 6 autogenerates OData controllers for Configured Commerce.
- A custom-built OData T4 template generates these controllers based on available entities.
- The ODataControllers.tt T4 template is maintained in the Insite.Admin library.
- Configured Commerce supports one level deep of any child navigation property.
- Entities can have properties marked as archivable with an active or deactivated state.
- Deleting items archives the entity.
- Archiving is used generically across entities.
- To retrieve archived entities, use the
archivedFilter=1
OData query. - For example, to retrieve archived customers:
/api/v1/admin/customers?&archiveFilter=1
.
Consuming the Admin API
- Postman simplifies API development and helps manage the API lifecycle.
- You can use tools like Curl or Fiddler to consume the Admin API.
- To consume storefront REST APIs, create a POST request at: [http or https]://[YOUR_WEBS-TE_URL]/identity/connect/token.
- Use Basic Auth with username 'isc' and password '009AC476-B28E-4E33-8BAE-B5F103A142BC'.
- In the Body, select
x-www-form-urlencoded
. - Fill in the required information:
-
grant_type
:password
-
username
: [web user name (e.g., basicuser)] -
password
: [web user password (e.g., Password1)] -
scope
:iscapi offline_access
-
Admin API Authentication
- The Admin API uses different scope and user credentials compared to the website access.
- The
offline_access
scope returns a refresh token along with the bearer token. - The bearer token expires after 15 minutes (900 seconds).
- The refresh token allows you to get a new bearer token without specifying the username and password.
- The refresh token is stored in local storage and used only when requesting a new bearer token.
- To consume Admin REST API, create a POST request at: [http or https]://[YOUR_WEBSITE_URL]/identity/connect/token.
- Use Basic Auth with username 'isc_admin' and password 'F684FC94-B3BE-4BC7-B924-636561177C8F'.
- In the Body, select
x-www-form-urlencoded
. - Fill in the required information:
-
grant_type
:password
-
username
:admin_[console user name]
(e.g., admin) -
password
: [console user password (e.g., Password1)] -
scope
:isc_admin_api offline_access
-
Admin API Response Handling
- If the bearer token is expired, any call to the Admin API will receive a 401 Unauthorized response.
- You can apply OData query string parameters to refine requests using OData standards.
- Configured Commerce returns a maximum of 100 results per request.
-
OData.NextLink
provides the next set of results.
Admin API and OData
- Configured Commerce uses OData syntax for the Admin API, unlike the Storefront API.
- For example, to retrieve a single product:
- Storefront API:
/api/v1/products/f88d5c07-eb72-42eb-ab36-a5d201168a49
- Admin API:
/api/v1/admin/products(f88d5c07-eb72-42eb-ab36-a5d201168a49)
- Storefront API:
Child Collection Retrieval
- Configured Commerce supports one level deep of child collections using OData.
- You can retrieve child collections using two methods:
- Using the
expand
parameter in the query string (e.g./api/v1/websites(d24h5c07-eb72-42eb-ab36-a5d201168jh5)?$expand=countries
) - Using the child entity name after the slash (e.g.
/api/v1/websites(d24h5c07-eb72-42eb-ab36-a5d201168jh5)/countries
)
- Using the
Updating Entities
- All entities in Configured Commerce have a Patch endpoint for the Admin API.
- To update an entity, include the new property and value in the JSON body and the authentication bearer token in the request header.
Entities and Data Provider
- The Insite.Data.Entities library contains the model objects without business logic.
- Configured Commerce uses the UnitOfWork pattern and a data provider implementation for Entity Framework.
- You can use repositories from Unit of work to retrieve an IQueryable object.
- All entities have an OData RESTful service.
- The T4 template generates the classes and enables extensibility through partial classes.
Swagger
- Use Swagger to view and interact with the Storefront and Admin API endpoints.
- You can access the endpoints in the left navigation (Storefront API V1, Storefront API V2, or Admin API V1).
Admin API Endpoints
-
Url Prefix:
/api/v1/admin/
- The table below summarizes the generic endpoint definitions.
| HTTP Verb | URL | Description |
|-------------|-----------------------------|-------------------------------------------------------------------------------------------------------------------|
| GET | entity | Retrieves all the objects |
| POST | entity | Creates a new object. Use
entity/Default.Default()
to get an instance with default values. | | GET | entity({id}) | Retrieves the object by the specified ID. | | PUT | entity({id}) | Update or create an object by the specified ID. | | DELETE | entity({id}) | Deletes an object by the specified ID. | | PATCH | entity({id}) | Updates properties on an existing object by the specified ID. | | GET | entity({key})/child({childKey}) | Retrieves a single child by its ID relative to the parent object. | | GET | entity({key})/customproperties({custompropertyKey}) | Retrieves the value of a single custom property on an object. |
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Related Documents
Description
Explore the modular architecture and RESTful APIs of the Optimizely Configured Commerce Admin Console. This quiz covers various aspects including OData controllers and archivable entities, offering insights into effective third-party application integration.