You Do: Add a Content Source

We'll begin configuring our environment by setting up our first content source. We'll use the Arc Content API as an example.

  1. To add a content source, click the green “New Content Source“ button in the upper right-hand corner. This will trigger a form with three fields to appear.

  2. Add a service ID. This value can be string, but it's best to make service IDs memorable. For ease of setup and learning, let's name this content service content-api.

  3. Add a content type. This value can also be any string, but it's best to make the content type generic enough to apply to other content sources that return data in the same pattern. Let's give our content service a type of content-api.

  4. Finally, we need to add the pattern for our API. This is the API endpoint for our content source. We'll use this API:

    https://name:[email protected]/content/v2/stories/

    A few things to note about this API:

    • Each Arc client has its own Content API, and every client API requires a set of basic auth credentials. Contact an Arc developer to get the API creds for our sample API, then replace name:password with the creds before entering it as your API pattern.
    • To find the API credentials, visit https://applications.admin.arcpublishing.com/trident-manager/deployments/demo. Then, click show credentials and use the latest credentials, and use https://<user>:<pass>@api.demo.arcpublishing.com/content/v3/stories/ as the pattern
    • This is just a basic endpoint; to make it retrieve content, we'll need to add a couple of parameters.
      • The Display Name is the user-friendly name that will be displayed to end users in the admin. These names should be non-technical, so that a newsroom editor could understand it.
      • The Parameter is the technical value that you want to pass into the API. For example, in the case of our content-api, we need to specify a canonical_url value that will represent the URI of the story we want to access.
      • The Type field determines the data type of the value.
      • The Default field will populate a fallback/default value in case a user-inputted value comes back empty.
      • The Drop When Empty option determines whether or not to append the parameter even if a user-inputted value comes back back.

    We need to add the two parameters shown above. Use the image as a reference as you set up your content source.

    1. Each content source will use different parameters...or no parameters at all. Depends on the API.
  5. To create the content source, click the green “Create” button—et voila! Your first content source is all set up and ready to use.

  6. Last step? Make sure it works! Using the path /baseball/2018/02/28/nationals-still-figuring-out-baseballs-new-pace-of-play-rules-in-spring-training/, test if the content source works via the Debugger (http://localhost:8888/pb/admin/app/tools/debugger.html).

results matching ""

    No results matching ""