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?
- Modularized architecture (correct)
- Layered architecture
- Monolithic architecture
- Microservices architecture
Which method is used to generate OData controllers in Configured Commerce?
Which method is used to generate OData controllers in Configured Commerce?
- OData Web API
- Data Access Layer
- Code-First migration
- Entity Framework Code First (correct)
Which property setting archives a product entity in Configured Commerce?
Which property setting archives a product entity in Configured Commerce?
- Removing the product from the catalog
- Deactivating the entity
- Setting the DateTime deactivate property (correct)
- Changing the archive property to True
How is the Admin API for retrieving archived entities accessed?
How is the Admin API for retrieving archived entities accessed?
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?
What is true about the archiving of entities in Configured Commerce?
What is true about the archiving of entities in Configured Commerce?
Where are the querying, updating, and deleting operations located in Configured Commerce?
Where are the querying, updating, and deleting operations located in Configured Commerce?
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?
What is the purpose of the refresh token in the authorization process?
What is the purpose of the refresh token in the authorization process?
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?
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?
What is the scope needed to access the Admin API?
What is the scope needed to access the Admin API?
Where is the refresh token stored after it is received?
Where is the refresh token stored after it is received?
What should be done to consume the Admin REST API?
What should be done to consume the Admin REST API?
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?
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?
Which type of authentication is used for the Admin API?
Which type of authentication is used for the Admin API?
What is the URL prefix for accessing Admin API endpoints?
What is the URL prefix for accessing Admin API endpoints?
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?
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?
What is the purpose of the GET entity/Default.Default() operation?
What is the purpose of the GET entity/Default.Default() operation?
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?
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?
What happens when the DELETE entity({id}) operation is performed?
What happens when the DELETE entity({id}) operation is performed?
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?
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?
How can a child collection be retrieved using the Admin API?
How can a child collection be retrieved using the Admin API?
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?
Which library replaced the Insite.Model library in Configured Commerce?
Which library replaced the Insite.Model library in Configured Commerce?
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?
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?
What does the OData.NextLink typically contain when retrieving results?
What does the OData.NextLink typically contain when retrieving results?
Flashcards
Admin API
Admin API
An API used to manage data in Configured Commerce, accessed via RESTful endpoints.
RESTful APIs
RESTful APIs
APIs that use HTTP methods (e.g., GET, POST, PUT, DELETE) to access and manipulate data.
Entity Framework Code First
Entity Framework Code First
A framework that automatically creates database tables from classes (entities).
OData
OData
Signup and view all the flashcards
OData controllers
OData controllers
Signup and view all the flashcards
T4 template
T4 template
Signup and view all the flashcards
Archiving
Archiving
Signup and view all the flashcards
Archived Filter
Archived Filter
Signup and view all the flashcards
Bearer Token
Bearer Token
Signup and view all the flashcards
Refresh Token
Refresh Token
Signup and view all the flashcards
Postman
Postman
Signup and view all the flashcards
Curl
Curl
Signup and view all the flashcards
Fiddler
Fiddler
Signup and view all the flashcards
Authentication scope
Authentication scope
Signup and view all the flashcards
Basic Auth
Basic Auth
Signup and view all the flashcards
Patch endpoint
Patch endpoint
Signup and view all the flashcards
Max Results
Max Results
Signup and view all the flashcards
OData.NextLink
OData.NextLink
Signup and view all the flashcards
Child Collection
Child Collection
Signup and view all the flashcards
Expand parameter
Expand parameter
Signup and view all the flashcards
UnitOfWork
UnitOfWork
Signup and view all the flashcards
Custom Properties
Custom Properties
Signup and view all the flashcards
Data Provider
Data Provider
Signup and view all the flashcards
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.