Integrate with the HCMS: Authenticate and Use Your Token in Subsequent Requests

Prev Next

For this, you’ll need access to both sets of API (application program interface) documentation and the credentials for the client you wish to use for the HCMS integration. You will need to grant the client access to what you want to do with your integration in the Clients tab and your permission set(s) if needed. For example, if you are integrating with content types, you will just need to provide owner access to the app for that client by specifying on the client tab; if you want to create content with your integration, you will want to provide the client access to the permission set(s) in addition to providing it access to the app.

Instructions

  1. You’ll first want to retrieve your access token Integrating with the HCMS key content type.

  2. Next, you will want to copy the access_token to use for authorization for all API requests. Access token.

  3. Using Postman, you can select the Authorization tab and select Bearer Token for the type Authorization tab.

  4. Now you can post to the API. For this example, we will be creating a content item. You can find documentation for this step in your app-specific API documentation. Integrating with the HCMS post API.

    Note: You can retrieve the permission set id from the permission set screen. If you click the gear icon to edit the permission set, the id will be the last part of the URL. You can also use the API to get permission sets as documented.

If desired, here is the curl request for creating content that you can copy/paste:

curl --location --request POST 'https://content-sandbox.civicplus.com/api/content/cp-civiccity/link?publish=true' \--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IjkxRkRENEVCRDYwNjMxNURFREI4MENEMDkzMERFRkZBMjFEREE2NkIiLCJ0eXAiOiJKV1QiLCJ4NXQiOiJrZjNVNjlZR01WM3R1QXpRa3czdi1pSGRwbXMifQ.eyJuYmYiOjE1OTIzMjU2NTgsImV4cCI6MTU5NDkxNzY1OCwiaXNzIjoiaHR0cHM6Ly9jb250ZW50LXNhbmRib3guY2l2aWNwbHVzLmNvbS9pZGVudGl0eS1zZXJ2ZXIiLCJhdWQiOlsiaHR0cHM6Ly9jb250ZW50LXNhbmRib3guY2l2aWNwbHVzLmNvbS9pZGVudGl0eS1zZXJ2ZXIvcmVzb3VyY2VzIiwiaGNtcy1hcGkiXSwiY2xpZW50X2lkIjoiY3AtY2l2aWNjaXR5OnBvc3RtYW4iLCJzY29wZSI6WyJoY21zLWFwaSJdfQ.jSonghPxUMJlx3v3jiJIcR1yuni-7n5r4-q56vXp6lQsyyPpZ-o6l47QVkclABM8Gp0yNAmcwNR1M93e83T' \--header 'Content-Type: application/json' \--data-raw '{  "data": {    "Link": {      "en": {        "openInNewWindow": true,        "url": "https://civicplus.com",        "displayName": "CivicPlus"      }    }  },  "categories": [    {      "id": "6286922f-b208-492c-8436-f9bb3965ea56"    }  ],  "tags": [    "Civicplus", "Help Center"  ],  "permissionSet": {    "id": "cc6008aa-b2f0-4f34-8b80-52a50d62ded5"  }}'