8. Add Value Accessor Set for SourceΒΆ

The source object is a JObject in the JArray created from the response. The value accessor set defines the values that are available in the JObject.

Note

Refer to the sample object below while configuring the value accessor set.

{
  "source": {
    "id": "lorem",
    "name": "Lorem"
  },
  "author": "Lorem Ipsum",
  "title": "Aliquam volutpat elit turpis, et rhoncus sapien maximus quis",
  "description": "Aliquam lacus velit, eleifend quis leo vitae, condimentum cursus nisi.",
  "url": "https://www.lipsum.com/feed/html",
  "urlToImage": "http://via.placeholder.com/350x150",
  "publishedAt": "2017-11-01T00:00:00Z"
}
  1. In Sitecore, open Content Editor.

  2. Navigate to sitecore > system > Data Exchange > Data Exchange Tenant for News API > Data Access > Value Accessor Sets > Providers.

  3. Add RESTful Value Accessor Sets.

    Hint

    This template is a command template. It does not prompt for the item name. The command template assigns the item name automatically.

    use-restful-provider\news\create-connector\_static/add-value-accessor-sets.png

    The new value accessor sets folder in Content Editor.

    use-restful-provider\news\create-connector\_static/restful-value-accessor-sets-root.png
  4. Navigate to sitecore > system > Data Exchange > Data Exchange Tenant for News API > Data Access > Value Accessor Sets > Providers > RESTful.

  5. Add Token Value Accessor Set with the following field values:

    Name Value
    Name Article Values

The new value accessor set in Content Editor.

use-restful-provider\news\create-connector\_static/value-accessor-set-for-source.png
  1. Navigate to sitecore > system > Data Exchange > Data Exchange Tenant for News API > Data Access > Value Accessor Sets > Providers > RESTful > Article Values.

  2. Add Token Value Accessor with the following field values:

    Name Value
    Name Source Id
    Path Expression source.id

    Note

    The path expression is made up of property names and array indexes separated by periods.

  3. Add Token Value Accessor with the following field values:

    Name Value
    Name Source Name
    Path Expression source.name
  4. Add Token Value Accessor with the following field values:

    Name Value
    Name Author
    Path Expression author
  5. Add Token Value Accessor with the following field values:

Name Value
Name Title
Path Expression title
  1. Add Token Value Accessor with the following field values:
Name Value
Name Description
Path Expression description
  1. Add Token Value Accessor with the following field values:
Name Value
Name Url
Path Expression url
  1. Add Token Value Accessor with the following field values:
Name Value
Name Image Url
Path Expression urlToImage
  1. Add Token Value Accessor with the following field values:
Name Value
Name Published At
Path Expression publishedAt

The new value accessors in Content Editor.

use-restful-provider\news\create-connector\_static/restful-value-accessors.png