APIs - Storefront API
32 Questions
3 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What is the purpose of the initial AJAX request to '/identity/connect/token'?

  • To obtain an access token for authorization. (correct)
  • To retrieve product information.
  • To create a new user account.
  • To start a new session in the application.
  • Which HTTP method is used when creating a session with the AJAX request to '/api/v1/sessions'?

  • PUT
  • DELETE
  • GET
  • POST (correct)
  • What does the 'beforeSend' function in the second AJAX request handle?

  • Attaching the access token to the request. (correct)
  • Validating the user credentials.
  • Defining the data to be sent with the request.
  • Setting the content type for the request.
  • Why is the bearer token not included in the request to retrieve the product catalog?

    <p>The product catalog does not require authentication.</p> Signup and view all the answers

    Which property of the AJAX request to '/api/v1/products' specifies the page number?

    <p>data</p> Signup and view all the answers

    What will the success callback function of the request to retrieve all categories log?

    <p>A list of all categories in JSON format.</p> Signup and view all the answers

    What mechanism is primarily used for handling cross-domain requests in the initial AJAX call?

    <p>CORS (Cross-Origin Resource Sharing)</p> Signup and view all the answers

    When searching for a product using a query, which method should be specified to retrieve the relevant products?

    <p>GET</p> Signup and view all the answers

    What HTTP method is used to add a product to the shopping cart?

    <p>POST</p> Signup and view all the answers

    Which of the following data fields is necessary when updating the quantity of a product in the shopping cart?

    <p>qtyOrdered</p> Signup and view all the answers

    What is the purpose of the 'beforeSend' function in the AJAX requests?

    <p>To set the authorization header</p> Signup and view all the answers

    What is the final step in the shopping process described?

    <p>Submitting the order</p> Signup and view all the answers

    Which URL is used to change the quantity of a specific product in the shopping cart?

    <p>api/v1/carts/current/cartlines/{cartLineId}</p> Signup and view all the answers

    In the context of submitting an order, what additional information must be provided?

    <p>Shipping address and payment method</p> Signup and view all the answers

    When the success callback is executed for adding a product, what type of data does it log?

    <p>Response data in JSON format</p> Signup and view all the answers

    Which of the following is NOT a step mentioned in managing an online shopping cart?

    <p>Add product to wishlist</p> Signup and view all the answers

    What is the primary purpose of the Storefront API?

    <p>To facilitate digital commerce activities like managing user accounts and shopping carts.</p> Signup and view all the answers

    Which two actions are involved in signing into Configured Commerce?

    <p>Authenticating with Identity Server and creating a Configured Commerce session.</p> Signup and view all the answers

    What allows for seamless upgrades in the Configured Commerce REST APIs?

    <p>Ensuring that the façade in front of the application is maintained.</p> Signup and view all the answers

    How does the Administrative API differ from the Storefront API?

    <p>The Administrative API allows access to all objects in the platform, not limited to user context.</p> Signup and view all the answers

    What sequence of actions does the basic commerce workflow using the Storefront API not include?

    <p>Changing the password for a user.</p> Signup and view all the answers

    What feature of the Storefront API enhances developer flexibility?

    <p>Allowing customizations outside of the platform.</p> Signup and view all the answers

    What is the first step in the basic commerce workflow using the Storefront API?

    <p>Sign In and Create B2B Session.</p> Signup and view all the answers

    Which HTTP verbs are primarily used in the conception of the API objects?

    <p>GET, POST, PUT, DELETE.</p> Signup and view all the answers

    What type of request is used to retrieve product details by productId?

    <p>GET</p> Signup and view all the answers

    Which data type is specified for the AJAX calls in the provided code?

    <p>json</p> Signup and view all the answers

    What is the purpose of the 'beforeSend' function in the AJAX request?

    <p>To add authorization headers before the request is sent.</p> Signup and view all the answers

    What should be modified when retrieving product details based on search results?

    <p>The productId being queried.</p> Signup and view all the answers

    How is a wishlist created in the provided code?

    <p>By sending a POST request with a name parameter.</p> Signup and view all the answers

    What information is required when adding a product to a wishlist?

    <p>The productId, quantity ordered, and unit of measure.</p> Signup and view all the answers

    What action will the second AJAX request accomplish?

    <p>It will add a product to an existing wishlist.</p> Signup and view all the answers

    Which of the following is true about the 'productId' used in the requests?

    <p>It must be unique for each product being retrieved.</p> Signup and view all the answers

    Study Notes

    Configured Commerce REST APIs

    • The Configured Commerce REST API is made up of RESTful-based services that interact with Configured Commerce data using JSON objects.
    • The API objects and their respective methods are based on common HTTP verbs.

    Storefront API

    • Built with the following considerations:
      • Open up the platform for connected commerce.
      • Allow developers to create customizations outside the platform.
      • Offer a developer-friendly, flexible, and modern experience.
      • Allow for seamless upgrades.
      • Create a facade for the application to minimize interruption during improvements.
      • Ensure scalability.

    Storefront API vs Administrative API

    • Storefront API: Delivers digital commerce functionality (viewing products, adding products to carts, user account management).
    • Administrative API: Provides data-level access to all objects. Used for integrating other platforms requiring access to all Configured Commerce objects.

    Building a Digital Commerce Workflow with Storefront API using jQuery

    • Sign In and Create B2B Session:
      • Requires two requests: authentication with Identity Server and creation of a Configured Commerce session.
      • The first request authenticates with Identity Server using a POST request to /identity/connect/token.
      • The second request creates a session within Configured Commerce using a POST request to /api/v1/sessions.
    • Retrieve Product Catalog:
      • Retrieves the product catalog available within the current context (user, customer, website).
      • Uses a GET request to /api/v1/products.
    • Retrieve All Categories:
      • Retrieves all categories.
      • Uses a GET request to /api/v1/categories.
    • Search for Product Using a Query:
      • Uses a GET request to /api/v1/products.
      • Includes the query parameter for the search term.
    • Retrieve Product Details:
      • Returns details of a specific product identified by productId.
      • Uses a GET request to /api/v1/products.
      • Includes the productId parameter.
    • Create Wishlist and Add Product to Wish List:
      • Creates a new wishlist with a POST request to /api/v1/wishlists.
      • Adds a product to the wishlist with a POST request to /api/v1/wishlists/{wishListId}/wishlistlines.
    • Add Product to Shopping Cart:
      • Adds a product to the current user's cart with a POST request to /api/v1/carts/current/cartlines.
      • Includes productId and qtyOrdered parameters.
    • Change Quantity of Product in Shopping Cart:
      • Updates the quantity of a product in the cart using a PATCH request to /api/v1/carts/current/cartlines/{cartLineId}.
      • Includes the id (cartLineId) and qtyOrdered parameters.
    • Submit Order:
      • Completes the order using a PATCH request to /api/v1/carts/current.
      • The request data includes updated cart details (shipping information, payment method, etc.).

    Studying That Suits You

    Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

    Quiz Team

    Related Documents

    Storefront API PDF

    Description

    This quiz explores the key features and functionalities of Configured Commerce REST APIs, including the distinction between Storefront and Administrative APIs. It highlights how these APIs facilitate connected commerce, enhance developer experiences, and ensure scalability. Test your knowledge on the integration and usage of these APIs in a modern storefront setup.

    More Like This

    General	B2B Commerce Cloud API Reference
    32 questions
    General Architecture	Extensions
    8 questions

    General Architecture Extensions

    SupportedAstatine4145 avatar
    SupportedAstatine4145
    Use Quizgecko on...
    Browser
    Browser