Documentation Index

Fetch the complete documentation index at: https://www.civicplus.help/llms.txt

Use this file to discover all available pages before exploring further.

HCMS: Authenticate and Reuse Token in 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 sets (or sets) 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 it on the Client tab; if you want to create content with your integration, you will want to provide the client access to the permission sets in addition to providing it access to the app.

Instructions

  1. You’ll first want to retrieve your access token:
    API request details showing headers and content type for a POST request.

  2. Next, you will want to copy the access_token to use for authorization for all API requests:
    Postman interface showing token request with highlighted access token and parameters.

  3. Using Postman, you can select the Authorization tab and select Bearer Token for the type:
    Authorization section showing Bearer Token for API request authentication.

  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:
    JSON data structure showing CivicPlus link and categories for API content.

    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 and/or 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"  }}'