Delib | Developer Docs
Knowledge Base
  • Delib
    • 👋Welcome
    • Our Products
  • Security Centre
    • Information Security
      • Service Level Agreement (SLA)
      • Disaster Recovery
      • Certifications
      • Information Security Downloadable Documents
    • Privacy and GDPR
      • How do Delib's products comply with the GDPR?
      • Delib Sub Processors
  • Citizen Space
    • Getting Started With Citizen Space
    • Deployment Requirements
      • How to set up a CNAME record for a custom domain name
      • Department structures
      • Users and permissions
      • Theming requirements
    • Security Configurations
      • Single Sign On (SSO)
        • Citizen Space Single Sign-on (SSO) - Linking Accounts
      • Two factor authentication (2FA)
      • Configurable password policy
      • Log in back-off
      • Security Notifications
      • Password reset date on export
      • Session Length
    • Integrations
      • How to integrate Citizen Space into existing website
    • Data API
      • API specification
      • Generating API keys
      • Basic Auth headers with Citizen Space
    • Public API
      • Public API v2.x guide
      • Version 2.4 reference
    • Webhooks
      • Creating and managing webhooks
  • Geospatial
    • Set-up process for existing customers
      • How to find your Ordnance Survey API key
      • Linking your Ordnance Survey account to Citizen Space
  • Integrations and Playbooks
    • Google Looker Studio
      • Google Looker Studio
      • Google Looker Studio Simple Activity Counts
    • Microsoft
      • PowerBI Dashboards
Powered by GitBook
On this page
  • Show API key
  • List activities
  • Inspect survey information
  • Inspect survey pages
  • Inspect survey questions
  • Inspect survey components
  • List responses
  • Inspect a response
  1. Citizen Space
  2. Data API

API specification

This is v1.0 of the data API and this documentation is subject to change.

For a full list of endpoints you can add /api/1/docs to the end of your Citizen Space URL eg:

https://demo.citizenspace.com/api/1/docs

For a list of endpoints and example outputs read on below.

Show API key

GET /api/1/whoami

Return the name of the API key that matches your authentication method.

Headers

Name
Value

Authorization

Basic <base64 key:secret>

Response

{
  "Test Key"
}
{
  "_anonymous_"
}

List activities

GET /api/1/activities

Return a list of activities including uid, state, start date, end date, and path.

Headers

Name
Value

Authorization

Basic <base64 key:secret>

Response

{
        "uid": "67f18beb302944c9944e06521cfxxxxx",
        "title": "Smallville resident forum",
        "state": "open",
        "start_date": "2023-03-29T00:00:00",
        "end_date": "2027-03-26T00:00:00",
        "path": "demo/smallville-resident-forum"
},
{"error_message": "Forbidden: Unauthorized: activity_search failed permission check"}

Inspect survey information

GET /api/1/activities/{activity_uid}/survey

Requires the activity_uid and returns basic information about the activity.

Headers

Name
Value

Authorization

Basic <base64 key:secret>

Response

{
    "link_text": "Online Survey",
    "question_numbering": "continuous",
    "linear": true,
    "body": "",
    "factbank_heading": "Related information",
    "factbank": "",
    "thankyou_message": "Thank you for your response.",
    "email_thankyou_message": "Thank you for your response.",
    "has_skip_logic": false
}
{"error_message": "Forbidden: Unauthorized: activity_search failed permission check"}

Inspect survey pages

GET /api/1/activities/{activity_uid}/pages

Requires the activity_uid and returns basic information about the pages of an activity.

Headers

Name
Value

Authorization

Basic <base64 key:secret>

Response

{
        "id": "intro",
        "title": "Introduction",
        "body": "",
        "factbank": "",
        "factbank_heading": "Related information",
        "skip_logic_rules": [],
        "type": "SubPage"
}
{"error_message": "Forbidden: Unauthorized: activity_search failed permission check"}

Inspect survey questions

GET /api/1/activities/{activity_uid}/questions

Requires the activity_uid and returns basic information about the pages of an activity.

Headers

Name
Value

Authorization

Basic <base64 key:secret>

Response

{
        "page_id": "intro",
        "id": "opsuite.respondentmanagement.name",
        "title": "What is your name?",
        "number": "1",
        "analyst_only": false
    },
    {
        "page_id": "intro",
        "id": "quickconsult.email",
        "title": "What is your email address?",
        "number": "2",
        "analyst_only": false
    },
{"error_message": "Forbidden: Unauthorized: activity_search failed permission check"}

Inspect survey components

GET /api/1/activities/{activity_uid}/components

Returns a list of survey components and associated information.

Headers

Name
Value

Authorization

Basic <base 64 key:secret>

Response

{
        "id": "opsuite.respondentmanagement.name_subquestion",
        "type": "textsubquestion",
        "visibility": [
            "analyst",
            "public"
        ],
        "required": false,
        "label": "Name",
        "heading": "Name",
        "validation_options": [],
        "page_id": "intro",
        "question_id": "opsuite.respondentmanagement.name"
    },
    {
        "id": "opsuite.respondentmanagement.name-quickconsult.analysis.what_to_analyse_subquestion",
        "type": "whattoanalysesubquestion",
        "visibility": [
            "analyst"
        ],
        "required": false,
        "label": null,
        "heading": "Analyst notes",
        "character_limit": 0,
        "page_id": "intro",
        "question_id": "opsuite.respondentmanagement.name"
    },
    
{"error_message": "Forbidden: Unauthorized: activity_search failed permission check"}

List responses

GET /api/1/activities/{activity_uid}/responses

Requires an activity_uid and returns a list of responses and associated id.

Headers

Name
Value

Authorization

Basic <base64 key:secret>

Response

{
        "id": "ANON-XXXX-YYYY-C",
        "completed": true,
        "deleted": false,
        "answers": {
            "Name (opsuite.respondentmanagement.name_subquestion)": "Test",
            "Email (quickconsult.email_subquestion)": "test@example.com",
            "Organisation (opsuite.respondentmanagement.organisation_subquestion)": "Test Organisation",
            "Visited Pages (__userinfo_pages_visited)": [
                "intro"
            ],
            "IP Address (__userinfo_ip)": "...",
            "Browser Identification (__userinfo_useragent)": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36",
            "Survey State (__userinfo_state)": "open",
            "Citizen Space Version (__userinfo_cs_version)": [
                "v7.27.0"
            ]
        }
    },
{"error_message": "Forbidden: Unauthorized: activity_search failed permission check"}

Inspect a response

GET /api/1/activities/{activity_uid}/responses/{response_id}

Return information of a single response. Requires activity_uid and id as parameters.

Headers

Name
Value

Authorization

Basic <base64 key:secret>

Response

{
        "id": "ANON-XXXX-YYYY-C",
        "completed": true,
        "deleted": false,
        "answers": {
            "Name (opsuite.respondentmanagement.name_subquestion)": "Test",
            "Email (quickconsult.email_subquestion)": "test@example.com",
            "Organisation (opsuite.respondentmanagement.organisation_subquestion)": "Test Organisation",
            "Visited Pages (__userinfo_pages_visited)": [
                "intro"
            ],
            "IP Address (__userinfo_ip)": "...",
            "Browser Identification (__userinfo_useragent)": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36",
            "Survey State (__userinfo_state)": "open",
            "Citizen Space Version (__userinfo_cs_version)": [
                "v7.27.0"
            ]
        }
    }
{"error_message": "Forbidden: Unauthorized: activity_search failed permission check"}
PreviousData APINextGenerating API keys

Last updated 1 year ago