Practice Sharing Platform API Reference

This is the reference documentation for the Practice Sharing Platform API. Most API calls require an authentication token. To authenticate, take a look at the Profile, Billing and Access Control API reference documentation.

All API requests must be made over HTTPS. Calls made over plain HTTP will fail.

Browse the API endpoints by ...


By workflows

Benchmarks

This section contains APIs related to anonymized aggregated benchmarks


Alphabetical

Lists tree of page elements

endpoint
GET /api/content/
Query parameters
page
integer

A page number within the paginated result set.

Responses
count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

path
string

slug
string

Unique identifier that can be used in URL paths

picture
string

Picture icon that can be displayed alongside the title

title
string

Title of the page element

text
string

Long description of the page element

reading_time
string

Reading time of the material (in hh:mm:ss)

lang
string

account
string

Account that can edit the page element

extra
string

Extra meta data (can be stringify JSON)

nb_upvotes
integer

nb_followers
integer

upvote
string

follow
string

count
integer

results
array

slug
string

Unique identifier that can be used in URL paths

path
string

path from the root of content tree

indent
string

level in the content tree

account
string

Account that can edit the page element

title
string

Title of the page element

picture
string

Picture icon that can be displayed alongside the title

extra
string

Extra meta data (can be stringify JSON)

default_unit
string

score_weight
string

rank
string

required
string

frozen
string

url
string

segments
array

 

Examples
curl http://localhost:8040/api/content/
responds
{
  "count": 8,
  "next": null,
  "previous": null,
  "results": [
    {
      "slug": "metal",
      "path": null,
      "title": "Metal structures & equipment",
      "indent": 0
    },
    {
      "slug": "boxes-and-enclosures",
      "path": "/metal/boxes-and-enclosures",
      "title": "Boxes & enclosures",
      "indent": 1,
      "tags": [
        "industry",
        "pagebreak",
        "public",
        "scorecard"
      ]
    }
  ]
}

Lists comments on a page element

endpoint
GET /api/content/comments/{path}
Responses
count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

text
string

Long description of the page element

created_at
string

user
string

 

Examples
curl http://localhost:8040/api/content/comments/adjust-air-fuel-ratio
responds
{
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
    {
      "created_at": "2020-09-28T00:00:00.0000Z",
      "user": "steve",
      "text": "How long does it take to see improvements?"
    }
  ]
}

Comments on a page element

endpoint
POST /api/content/comments/{path}
Request body
text
string

Long description of the page element

Responses
text
string

Long description of the page element

created_at
string

user
string

 

Examples
curl -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{"text": "How long does it take to see improvements?"}' http://localhost:8040/api/content/comments/adjust-air-fuel-ratio
responds
{
  "created_at": "2020-09-28T00:00:00.0000Z",
  "user": "steve",
  "text": "How long does it take to see improvements?"
}

Retrieves a page element

endpoint
GET /api/content/detail/{path}
Responses
path
string

slug
string

Unique identifier that can be used in URL paths

picture
string

Picture icon that can be displayed alongside the title

title
string

Title of the page element

text
string

Long description of the page element

reading_time
string

Reading time of the material (in hh:mm:ss)

lang
string

account
string

Account that can edit the page element

extra
string

Extra meta data (can be stringify JSON)

nb_upvotes
integer

nb_followers
integer

upvote
string

follow
string

count
integer

results
array

slug
string

Unique identifier that can be used in URL paths

path
string

path from the root of content tree

indent
string

level in the content tree

account
string

Account that can edit the page element

title
string

Title of the page element

picture
string

Picture icon that can be displayed alongside the title

extra
string

Extra meta data (can be stringify JSON)

 

Examples
curl http://localhost:8040/api/content/detail/adjust-air-fuel-ratio
responds
{
  "slug": "adjust-air-fuel-ratio",
  "picture": null,
  "title": "Adjust air/fuel ratio",
  "text": "<h2>Background</h2><p>Some manufacturing processes may involve heating operations.</p>",
  "extra": null
}

Downvotes a page element

endpoint
POST /api/content/downvote/{path}

The authenticated user making the request indicates the practice is not worth implementing.

Request body
slug
string

Unique identifier that can be used in URL paths

picture
string

Picture icon that can be displayed alongside the title

title
string

Title of the page element

text
string

Long description of the page element

reading_time
string

Reading time of the material (in hh:mm:ss)

lang
string

nb_upvotes
integer

nb_followers
integer

count
integer

results
array

title
string

Title of the page element

picture
string

Picture icon that can be displayed alongside the title

Responses
path
string

slug
string

Unique identifier that can be used in URL paths

picture
string

Picture icon that can be displayed alongside the title

title
string

Title of the page element

text
string

Long description of the page element

reading_time
string

Reading time of the material (in hh:mm:ss)

lang
string

account
string

Account that can edit the page element

extra
string

Extra meta data (can be stringify JSON)

nb_upvotes
integer

nb_followers
integer

upvote
string

follow
string

count
integer

results
array

slug
string

Unique identifier that can be used in URL paths

path
string

path from the root of content tree

indent
string

level in the content tree

account
string

Account that can edit the page element

title
string

Title of the page element

picture
string

Picture icon that can be displayed alongside the title

extra
string

Extra meta data (can be stringify JSON)

 

Examples
curl -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{}' http://localhost:8040/api/content/downvote/adjust-air-fuel-ratio
responds
{
  "slug": "water-user",
  "title": "How to reduce water usage?"
}

List editable page elements

endpoint
GET /api/content/editables/{profile}

This API endpoint lists page elements that are owned and thus editable by an account.

Query parameters
q
string

A search term.

o
string

Which field to use when ordering the results.

Responses
count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

slug
string

Unique identifier that can be used in URL paths

path
string

path from the root of content tree

indent
string

level in the content tree

account
string

Account that can edit the page element

title
string

Title of the page element

picture
string

Picture icon that can be displayed alongside the title

extra
string

Extra meta data (can be stringify JSON)

 

Examples
curl http://localhost:8040/api/content/editables/alliance
responds
{
  "count": 5,
  "next": null,
  "previous": null,
  "results": [
    {
      "path": null,
      "title": "Construction",
      "tags": [
        "public"
      ],
      "indent": 0
    },
    {
      "path": null,
      "title": "Governance & management",
      "picture": "https://assets.tspproject.org/management.png",
      "indent": 1
    },
    {
      "path": "/construction/governance/the-assessment-process-is-rigorous",
      "title": "The assessment process is rigorous",
      "indent": 2,
      "extra": {
        "intrinsic_values": {
          "environmental_value": 1,
          "business_value": 1,
          "profitability": 1,
          "implementation_ease": 1,
          "avg_value": 1
        }
      }
    },
    {
      "path": null,
      "title": "Production",
      "picture": "https://assets.tspproject.org/production.png",
      "indent": 1
    },
    {
      "path": "/construction/production/adjust-air-fuel-ratio",
      "title": "Adjust Air fuel ratio",
      "indent": 2,
      "extra": {
        "intrinsic_values": {
          "environmental_value": 2,
          "business_value": 2,
          "profitability": 2,
          "implementation_ease": 2,
          "avg_value": 2
        }
      }
    }
  ]
}

Creates a page element

endpoint
POST /api/content/editables/{profile}
Request body
title
string

Title of the page element

picture
string

Picture icon that can be displayed alongside the title

Responses
slug
string

Unique identifier that can be used in URL paths

path
string

path from the root of content tree

indent
string

level in the content tree

account
string

Account that can edit the page element

title
string

Title of the page element

picture
string

Picture icon that can be displayed alongside the title

extra
string

Extra meta data (can be stringify JSON)

 

Examples
curl -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{"title": "Boxes enclosures"}' http://localhost:8040/api/content/editables/alliance
responds
{
  "slug": "boxes-enclosures",
  "title": "Boxes enclosures"
}

List questions in a campaign

endpoint
GET /api/content/editables/{profile}/campaigns/{campaign}
Query parameters
q
string

A search term.

o
string

Which field to use when ordering the results.

Responses
count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

slug
string

Unique identifier that can be used in URL paths

path
string

path from the root of content tree

indent
string

level in the content tree

account
string

Account that can edit the page element

title
string

Title of the page element

picture
string

Picture icon that can be displayed alongside the title

extra
string

Extra meta data (can be stringify JSON)

default_unit
string

score_weight
string

rank
string

required
string

frozen
string

url
string

segments
array

 

Examples
curl http://localhost:8040/api/content/editables/envconnect/campaigns/sustainability
responds
{
  "count": 5,
  "next": null,
  "previous": null,
  "results": [
    {
      "path": null,
      "title": "Construction",
      "tags": [
        "public"
      ],
      "indent": 0
    },
    {
      "path": null,
      "title": "Governance & management",
      "picture": "https://assets.tspproject.org/management.png",
      "indent": 1
    },
    {
      "path": "/construction/governance/the-assessment    -process-is-rigorous",
      "title": "The assessment process is rigorous",
      "indent": 2
    },
    {
      "path": null,
      "title": "Production",
      "picture": "https://assets.tspproject.org/production.png",
      "indent": 1
    },
    {
      "path": "/construction/production/adjust-air-fuel    -ratio",
      "title": "Adjust Air fuel ratio",
      "indent": 2
    }
  ]
}

Creates a practice

endpoint
POST /api/content/editables/{profile}/campaigns/{campaign}

Updates the title, text and, if applicable, the metrics associated associated to the content element referenced by path.

Request body
title
string

Title of the page element

picture
string

Picture icon that can be displayed alongside the title

url
string

segments
array

parents
array required

slug
string

title
string

Responses
slug
string

Unique identifier that can be used in URL paths

path
string

path from the root of content tree

indent
string

level in the content tree

account
string

Account that can edit the page element

title
string

Title of the page element

picture
string

Picture icon that can be displayed alongside the title

extra
string

Extra meta data (can be stringify JSON)

default_unit
string

score_weight
string

rank
string

required
string

frozen
string

url
string

segments
array

parents
array

slug
string

title
string

 

Examples
curl -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{"title": "Adjust air/fuel ratio", "parents": []}' http://localhost:8040/api/content/editables/alliance/campaigns/sustainability
responds
{
  "title": "Adjust air/fuel ratio",
  "parents": []
}

List segments in a campaign

endpoint
GET /api/content/editables/{profile}/campaigns/{campaign}/segments
Query parameters
page
integer

A page number within the paginated result set.

q
string

A search term.

o
string

Which field to use when ordering the results.

Responses
count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

slug
string

Unique identifier that can be used in URL paths

path
string

path from the root of content tree

indent
string

level in the content tree

account
string

Account that can edit the page element

title
string

Title of the page element

picture
string

Picture icon that can be displayed alongside the title

extra
string

Extra meta data (can be stringify JSON)

default_unit
string

score_weight
string

rank
string

required
string

frozen
string

url
string

segments
array

 

Examples
curl http://localhost:8040/api/content/editables/alliance/campaigns/sustainability/segments
responds
{
  "count": 5,
  "next": null,
  "previous": null,
  "results": [
    {
      "path": null,
      "title": "Construction",
      "tags": [
        "public"
      ],
      "indent": 0
    },
    {
      "path": null,
      "title": "Governance & management",
      "picture": "https://assets.tspproject.org/management.png",
      "indent": 1
    },
    {
      "path": "/construction/governance/the-assessment    -process-is-rigorous",
      "title": "The assessment process is rigorous",
      "indent": 2
    },
    {
      "path": null,
      "title": "Production",
      "picture": "https://assets.tspproject.org/production.png",
      "indent": 1
    },
    {
      "path": "/construction/production/adjust-air-fuel    -ratio",
      "title": "Adjust Air fuel ratio",
      "indent": 2
    }
  ]
}

Creates a segment in a campaign

endpoint
POST /api/content/editables/{profile}/campaigns/{campaign}/segments
Request body
title
string

Title of the page element

picture
string

Picture icon that can be displayed alongside the title

url
string

segments
array

Responses
slug
string

Unique identifier that can be used in URL paths

path
string

path from the root of content tree

indent
string

level in the content tree

account
string

Account that can edit the page element

title
string

Title of the page element

picture
string

Picture icon that can be displayed alongside the title

extra
string

Extra meta data (can be stringify JSON)

default_unit
string

score_weight
string

rank
string

required
string

frozen
string

url
string

segments
array

 

Examples
curl -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{"title": "Boxes enclosures"}' http://localhost:8040/api/content/editables/alliance/campaigns/sustainability/segments
responds
{
  "slug": "boxes-enclosures"
}

Uploads practices

endpoint
POST /api/content/editables/{profile}/campaigns/{campaign}/upload

Upload all practices, tiles and segments for a campaign from a CSV file.

Request body
title
string

Title of the page element

picture
string

Picture icon that can be displayed alongside the title

url
string

segments
array

Responses
slug
string

Unique identifier that can be used in URL paths

path
string

path from the root of content tree

indent
string

level in the content tree

account
string

Account that can edit the page element

title
string

Title of the page element

picture
string

Picture icon that can be displayed alongside the title

extra
string

Extra meta data (can be stringify JSON)

default_unit
string

score_weight
string

rank
string

required
string

frozen
string

url
string

segments
array

 

Examples
curl -X POST http://localhost:8040/api/content/editables/alliance/campaigns/sustainability/upload
responds
{
  "count": 5,
  "next": null,
  "previous": null,
  "results": [
    {
      "path": null,
      "title": "Construction",
      "tags": [
        "public"
      ],
      "indent": 0
    },
    {
      "path": null,
      "title": "Governance & management",
      "picture": "https://assets.tspproject.org/management.png",
      "indent": 1
    },
    {
      "path": "/construction/governance/the-assessment    -process-is-rigorous",
      "title": "The assessment process is rigorous",
      "indent": 2
    },
    {
      "path": null,
      "title": "Production",
      "picture": "https://assets.tspproject.org/production.png",
      "indent": 1
    },
    {
      "path": "/construction/production/adjust-air-fuel    -ratio",
      "title": "Adjust Air fuel ratio",
      "indent": 2
    }
  ]
}

Retrieves a question

endpoint
GET /api/content/editables/{profile}/campaigns/{campaign}/{path}
Responses
title
string

Title of the question as displayed in user interfaces

text
string

Long form description about the question

default_unit
string

Default unit for measured field when none is specified

extra
string

Extra meta data (can be stringify JSON)

path
string

Unique identifier that can be used in URL

 

Examples
curl http://localhost:8040/api/content/editables/envconnect/campaigns/sustainability/construction/governance/the-assessment-process-is-rigorous
responds
{
  "path": "/construction/governance/the-assessment-process-is-rigorous",
  "title": "The assessment process is rigorous",
  "default_unit": "assessment"
}

Creates a question

endpoint
POST /api/content/editables/{profile}/campaigns/{campaign}/{path}

Creates a new question under prefix path.

Request body
title
string

Title of the question as displayed in user interfaces

text
string

Long form description about the question

default_unit
string required

Default unit for measured field when none is specified

extra
string

Extra meta data (can be stringify JSON)

Responses
title
string

Title of the question as displayed in user interfaces

text
string

Long form description about the question

default_unit
string

Default unit for measured field when none is specified

extra
string

Extra meta data (can be stringify JSON)

path
string

Unique identifier that can be used in URL

 

Examples
curl -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{"title": "Adjust air/fuel ratio"}' http://localhost:8040/api/content/editables/alliance/campaigns/sustainability
responds
{
  "path": "/construction/governance/the-assessment-process-is-rigorous",
  "title": "The assessment process is rigorous",
  "default_unit": "assessment"
}

Updates a question

endpoint
PUT /api/content/editables/{profile}/campaigns/{campaign}/{path}

Updates the title, text and, if applicable, the metrics associated associated to the content element referenced by path.

Request body
title
string

Title of the question as displayed in user interfaces

text
string

Long form description about the question

default_unit
string required

Default unit for measured field when none is specified

extra
string

Extra meta data (can be stringify JSON)

Responses
title
string

Title of the question as displayed in user interfaces

text
string

Long form description about the question

default_unit
string

Default unit for measured field when none is specified

extra
string

Extra meta data (can be stringify JSON)

path
string

Unique identifier that can be used in URL

 

Examples
curl -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{"title": "Adjust air/fuel ratio"}' http://localhost:8040/api/content/editables/alliance/campaigns/sustainability
responds
{
  "path": "/construction/governance/the-assessment-process-is-rigorous",
  "title": "The assessment process is rigorous",
  "default_unit": "assessment"
}

Deletes questions

endpoint
DELETE /api/content/editables/{profile}/campaigns/{campaign}/{path}

Deletes all questions under prefix path.

Responses

204 No Content

 

Examples
curl -X DELETE http://localhost:8040/api/content/editables/alliance/campaigns/sustainability

Retrieves an editable page element

endpoint
GET /api/content/editables/{profile}/{path}
Responses
path
string

slug
string

Unique identifier that can be used in URL paths

picture
string

Picture icon that can be displayed alongside the title

title
string

Title of the page element

text
string

Long description of the page element

reading_time
string

Reading time of the material (in hh:mm:ss)

lang
string

account
string

Account that can edit the page element

extra
string

Extra meta data (can be stringify JSON)

nb_upvotes
integer

nb_followers
integer

upvote
string

follow
string

count
integer

results
array

slug
string

Unique identifier that can be used in URL paths

path
string

path from the root of content tree

indent
string

level in the content tree

account
string

Account that can edit the page element

title
string

Title of the page element

picture
string

Picture icon that can be displayed alongside the title

extra
string

Extra meta data (can be stringify JSON)

 

Examples
curl http://localhost:8040/api/content/editables/boxes-enclosures/
responds
{
  "slug": "boxes-enclosures",
  "path": "/boxes-enclosures",
  "text": "Hello"
}

Creates a page element under a prefix

endpoint
POST /api/content/editables/{profile}/{path}
Request body
slug
string

Unique identifier that can be used in URL paths

picture
string

Picture icon that can be displayed alongside the title

title
string

Title of the page element

text
string

Long description of the page element

reading_time
string

Reading time of the material (in hh:mm:ss)

lang
string

nb_upvotes
integer

nb_followers
integer

count
integer

results
array

title
string

Title of the page element

picture
string

Picture icon that can be displayed alongside the title

Responses
path
string

slug
string

Unique identifier that can be used in URL paths

picture
string

Picture icon that can be displayed alongside the title

title
string

Title of the page element

text
string

Long description of the page element

reading_time
string

Reading time of the material (in hh:mm:ss)

lang
string

account
string

Account that can edit the page element

extra
string

Extra meta data (can be stringify JSON)

nb_upvotes
integer

nb_followers
integer

upvote
string

follow
string

count
integer

results
array

slug
string

Unique identifier that can be used in URL paths

path
string

path from the root of content tree

indent
string

level in the content tree

account
string

Account that can edit the page element

title
string

Title of the page element

picture
string

Picture icon that can be displayed alongside the title

extra
string

Extra meta data (can be stringify JSON)

 

Examples
curl -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{"title": "Boxes enclosures"}' http://localhost:8040/api/content/editables/boxes-enclosures/
responds
{
  "slug": "boxes-enclosures",
  "text": "Hello"
}

Updates a page element

endpoint
PUT /api/content/editables/{profile}/{path}
Request body
slug
string

Unique identifier that can be used in URL paths

picture
string

Picture icon that can be displayed alongside the title

title
string

Title of the page element

text
string

Long description of the page element

reading_time
string

Reading time of the material (in hh:mm:ss)

lang
string

nb_upvotes
integer

nb_followers
integer

count
integer

results
array

title
string

Title of the page element

picture
string

Picture icon that can be displayed alongside the title

Responses
path
string

slug
string

Unique identifier that can be used in URL paths

picture
string

Picture icon that can be displayed alongside the title

title
string

Title of the page element

text
string

Long description of the page element

reading_time
string

Reading time of the material (in hh:mm:ss)

lang
string

account
string

Account that can edit the page element

extra
string

Extra meta data (can be stringify JSON)

nb_upvotes
integer

nb_followers
integer

upvote
string

follow
string

count
integer

results
array

slug
string

Unique identifier that can be used in URL paths

path
string

path from the root of content tree

indent
string

level in the content tree

account
string

Account that can edit the page element

title
string

Title of the page element

picture
string

Picture icon that can be displayed alongside the title

extra
string

Extra meta data (can be stringify JSON)

 

Examples
curl -X PUT -H 'Content-Type: application/json; charset=UTF-8' -d '{"title": "Boxes and enclosures"}' http://localhost:8040/api/content/editables/boxes-enclosures/
responds
{
  "slug": "boxes-enclosures",
  "text": "Hello"
}

Deletes a page element

endpoint
DELETE /api/content/editables/{profile}/{path}
Responses

204 No Content

 

Examples
curl -X DELETE http://localhost:8040/api/content/editables/boxes-enclosures/

Follows a page element

endpoint
POST /api/content/follow/{path}

The authenticated user making the request will receive notification whenever someone comments on the practice.

Request body
slug
string

Unique identifier that can be used in URL paths

picture
string

Picture icon that can be displayed alongside the title

title
string

Title of the page element

text
string

Long description of the page element

reading_time
string

Reading time of the material (in hh:mm:ss)

lang
string

nb_upvotes
integer

nb_followers
integer

count
integer

results
array

title
string

Title of the page element

picture
string

Picture icon that can be displayed alongside the title

Responses
path
string

slug
string

Unique identifier that can be used in URL paths

picture
string

Picture icon that can be displayed alongside the title

title
string

Title of the page element

text
string

Long description of the page element

reading_time
string

Reading time of the material (in hh:mm:ss)

lang
string

account
string

Account that can edit the page element

extra
string

Extra meta data (can be stringify JSON)

nb_upvotes
integer

nb_followers
integer

upvote
string

follow
string

count
integer

results
array

slug
string

Unique identifier that can be used in URL paths

path
string

path from the root of content tree

indent
string

level in the content tree

account
string

Account that can edit the page element

title
string

Title of the page element

picture
string

Picture icon that can be displayed alongside the title

extra
string

Extra meta data (can be stringify JSON)

 

Examples
curl -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{}' http://localhost:8040/api/content/follow/adjust-air-fuel-ratio
responds
{
  "slug": "water-user",
  "title": "How to reduce water usage?"
}

Searches page elements

endpoint
GET /api/content/search
Query parameters
page
integer

A page number within the paginated result set.

Responses
count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

path
string

slug
string

Unique identifier that can be used in URL paths

picture
string

Picture icon that can be displayed alongside the title

title
string

Title of the page element

text
string

Long description of the page element

reading_time
string

Reading time of the material (in hh:mm:ss)

lang
string

account
string

Account that can edit the page element

extra
string

Extra meta data (can be stringify JSON)

nb_upvotes
integer

nb_followers
integer

upvote
string

follow
string

count
integer

results
array

slug
string

Unique identifier that can be used in URL paths

path
string

path from the root of content tree

indent
string

level in the content tree

account
string

Account that can edit the page element

title
string

Title of the page element

picture
string

Picture icon that can be displayed alongside the title

extra
string

Extra meta data (can be stringify JSON)

 

Examples
curl http://localhost:8040/api/content/search
responds
{
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
    {
      "slug": "hello",
      "path": "/hello",
      "title": "Hello"
    }
  ]
}

Unfollows a page element

endpoint
POST /api/content/unfollow/{path}

The authenticated user making the request will stop receiving notification whenever someone comments on the practice.

Request body
slug
string

Unique identifier that can be used in URL paths

picture
string

Picture icon that can be displayed alongside the title

title
string

Title of the page element

text
string

Long description of the page element

reading_time
string

Reading time of the material (in hh:mm:ss)

lang
string

nb_upvotes
integer

nb_followers
integer

count
integer

results
array

title
string

Title of the page element

picture
string

Picture icon that can be displayed alongside the title

Responses
path
string

slug
string

Unique identifier that can be used in URL paths

picture
string

Picture icon that can be displayed alongside the title

title
string

Title of the page element

text
string

Long description of the page element

reading_time
string

Reading time of the material (in hh:mm:ss)

lang
string

account
string

Account that can edit the page element

extra
string

Extra meta data (can be stringify JSON)

nb_upvotes
integer

nb_followers
integer

upvote
string

follow
string

count
integer

results
array

slug
string

Unique identifier that can be used in URL paths

path
string

path from the root of content tree

indent
string

level in the content tree

account
string

Account that can edit the page element

title
string

Title of the page element

picture
string

Picture icon that can be displayed alongside the title

extra
string

Extra meta data (can be stringify JSON)

 

Examples
curl -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{}' http://localhost:8040/api/content/unfollow/adjust-air-fuel-ratio
responds
{
  "slug": "water-user",
  "title": "How to reduce water usage?"
}

Upvotes a page element

endpoint
POST /api/content/upvote/{path}

The authenticated user making the request indicates the practice is considered worthwhile implementing.

Request body
slug
string

Unique identifier that can be used in URL paths

picture
string

Picture icon that can be displayed alongside the title

title
string

Title of the page element

text
string

Long description of the page element

reading_time
string

Reading time of the material (in hh:mm:ss)

lang
string

nb_upvotes
integer

nb_followers
integer

count
integer

results
array

title
string

Title of the page element

picture
string

Picture icon that can be displayed alongside the title

Responses
path
string

slug
string

Unique identifier that can be used in URL paths

picture
string

Picture icon that can be displayed alongside the title

title
string

Title of the page element

text
string

Long description of the page element

reading_time
string

Reading time of the material (in hh:mm:ss)

lang
string

account
string

Account that can edit the page element

extra
string

Extra meta data (can be stringify JSON)

nb_upvotes
integer

nb_followers
integer

upvote
string

follow
string

count
integer

results
array

slug
string

Unique identifier that can be used in URL paths

path
string

path from the root of content tree

indent
string

level in the content tree

account
string

Account that can edit the page element

title
string

Title of the page element

picture
string

Picture icon that can be displayed alongside the title

extra
string

Extra meta data (can be stringify JSON)

 

Examples
curl -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{}' http://localhost:8040/api/content/upvote/adjust-air-fuel-ratio
responds
{
  "slug": "water-user",
  "title": "How to reduce water usage?"
}

Lists tree of page elements matching prefix

endpoint
GET /api/content/{path}
Responses
count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

path
string

slug
string

Unique identifier that can be used in URL paths

picture
string

Picture icon that can be displayed alongside the title

title
string

Title of the page element

text
string

Long description of the page element

reading_time
string

Reading time of the material (in hh:mm:ss)

lang
string

account
string

Account that can edit the page element

extra
string

Extra meta data (can be stringify JSON)

nb_upvotes
integer

nb_followers
integer

upvote
string

follow
string

count
integer

results
array

slug
string

Unique identifier that can be used in URL paths

path
string

path from the root of content tree

indent
string

level in the content tree

account
string

Account that can edit the page element

title
string

Title of the page element

picture
string

Picture icon that can be displayed alongside the title

extra
string

Extra meta data (can be stringify JSON)

default_unit
string

score_weight
string

rank
string

required
string

frozen
string

url
string

segments
array

 

Examples
curl http://localhost:8040/api/content/boxes-and-enclosures
responds
{
  "count": 8,
  "next": null,
  "previous": null,
  "results": [
    {
      "slug": "metal",
      "path": null,
      "title": "Metal structures & equipment",
      "indent": 0
    },
    {
      "slug": "boxes-and-enclosures",
      "path": "/metal/boxes-and-enclosures",
      "title": "Boxes & enclosures",
      "indent": 1,
      "tags": [
        "industry",
        "pagebreak",
        "public",
        "scorecard"
      ]
    }
  ]
}

Lists units

endpoint
GET /api/units

This API end-point lists all the units of measurement available to record datapoints.

Alongside the usual metric units (meters, kilogram, etc.) and imperial units (inch, pounds, etc.), there could be units with a rank system (natural integers), or an enumerated system (finite set of values with no order). A special unit is used to represent free form text.

Query parameters
page
integer

A page number within the paginated result set.

eq
string

units that can be used intercheably with this one

q
string

value to search for in the fields specified by q_f

q_f
string

restrict searches to one or more fields in: slug, title. searches all fields when unspecified.

Responses
count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

slug
string

Unique identifier that can be used in a URL

title
string

Short description suitable for display

system
string

One of standard (metric system), imperial, rank, enum, or freetext

choices
array

text
string

short name for the enumerated value (as used in source code)

descr
string

long form description of the enumerated value (for help tooltips)

 

Examples
curl http://localhost:8040/api/units
responds
{
  "count": 1,
  "previous": null,
  "next": null,
  "results": [
    {
      "slug": "assessment",
      "title": "assessments",
      "system": "enum",
      "choices": [
        {
          "rank": 1,
          "text": "mostly-yes",
          "descr": "Mostly yes"
        },
        {
          "rank": 2,
          "text": "yes",
          "descr": "Yes"
        },
        {
          "rank": 3,
          "text": "no",
          "descr": "No"
        },
        {
          "rank": 4,
          "text": "mostly-no",
          "descr": "Mostly no"
        }
      ]
    }
  ]
}

Retrieves a unit

endpoint
GET /api/units/{unit}

Retrieves the details of a Unit.

Responses
slug
string

Unique identifier that can be used in a URL

title
string

Short description suitable for display

system
string

One of standard (metric system), imperial, rank, enum, or freetext

choices
array

text
string

short name for the enumerated value (as used in source code)

descr
string

long form description of the enumerated value (for help tooltips)

 

Examples
curl http://localhost:8040/api/units/assessment
responds
{
  "slug": "assessment",
  "title": "assessments",
  "system": "enum",
  "choices": [
    {
      "rank": 1,
      "text": "mostly-yes",
      "descr": "Mostly yes"
    },
    {
      "rank": 2,
      "text": "yes",
      "descr": "Yes"
    },
    {
      "rank": 3,
      "text": "no",
      "descr": "No"
    },
    {
      "rank": 4,
      "text": "mostly-no",
      "descr": "Mostly no"
    }
  ]
}

Lists profile campaigns

endpoint
GET /api/{profile}/campaigns

Lists campaigns that belongs to a profile.

Query parameters
page
integer

A page number within the paginated result set.

start_at
string

date/time in ISO format

ends_at
string

date/time in ISO format

q
string

value to search for in the fields specified by q_f

q_f
string

restrict searches to one or more fields in: title. searches all fields when unspecified.

o
string

sort by created_at, title. If a field is preceded by a minus sign ('-'), the order will be reversed. Multiple 'o' parameters can be specified to produce a stable result.

Responses
count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

slug
string

Unique identifier that can be used in a URL

account
string

Account this sample belongs to.

title
string

Title of the campaign as displayed in user interfaces

description
string

Long form description displayed to users responding to the campaign

created_at
string

active
boolean

Whether the campaign is available or not

 

Examples
curl http://localhost:8040/api/alliance/campaigns
responds
{
  "count": 1,
  "results": [
    {
      "slug": "construction",
      "account": "alliance",
      "title": "Assessment on sustainable construction practices",
      "active": true
    }
  ]
}

Creates a campaign

endpoint
POST /api/{profile}/campaigns

Creates a campaign against which profiles can be assessed.

Request body
title
string required

Title of the campaign as displayed in user interfaces

description
string

Long form description displayed to users responding to the campaign

quizz_mode
boolean

If checked, correct answser are required

questions
array

title
string required

Title of the question as displayed in user interfaces

text
string

Long form description about the question

default_unit
string required

Default unit for measured field when none is specified

extra
string

Extra meta data (can be stringify JSON)

Responses
slug
string

Unique identifier that can be used in a URL

title
string

Title of the campaign as displayed in user interfaces

description
string

Long form description displayed to users responding to the campaign

quizz_mode
boolean

If checked, correct answser are required

questions
array

title
string

Title of the question as displayed in user interfaces

text
string

Long form description about the question

default_unit
string

Default unit for measured field when none is specified

extra
string

Extra meta data (can be stringify JSON)

 

Examples
curl -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{"title": "Sustainable construction practices"}' http://localhost:8040/api/alliance/campaigns
responds
{
  "slug": "sustainable-construction-practices",
  "title": "Sustainable construction practices"
}

Retrieves a campaign

endpoint
GET /api/{profile}/campaigns/{campaign}

Retrieves the details of a Campaign.

Responses
slug
string

Unique identifier that can be used in a URL

account
string

Account this sample belongs to.

title
string

Title of the campaign as displayed in user interfaces

description
string

Long form description displayed to users responding to the campaign

active
boolean

Whether the campaign is available or not

quizz_mode
boolean

If checked, correct answser are required

questions
array

path
string

Unique identifier that can be used in URL

title
string

Short description

default_unit
object

slug
string

Unique identifier that can be used in a URL

title
string

Short description suitable for display

system
string

One of standard (metric system), imperial, rank, enum, or freetext

choices
array

text
string

short name for the enumerated value (as used in source code)

descr
string

long form description of the enumerated value (for help tooltips)

ui_hint
string

Hint for the user interface on how to present the input field

 

Examples
curl http://localhost:8040/api/alliance/campaigns/sustainability
responds
{
  "slug": "construction",
  "account": "alliance",
  "title": "Assessment on sustainable construction practices",
  "active": true,
  "quizz_mode": false,
  "questions": [
    {
      "path": "/construction/product-design",
      "title": "Product Design",
      "default_unit": {
        "slug": "assessment",
        "title": "assessments",
        "system": "enum",
        "choices": [
          {
            "rank": 1,
            "text": "mostly-yes",
            "descr": "Mostly yes"
          },
          {
            "rank": 2,
            "text": "yes",
            "descr": "Yes"
          },
          {
            "rank": 3,
            "text": "no",
            "descr": "No"
          },
          {
            "rank": 4,
            "text": "mostly-no",
            "descr": "Mostly no"
          }
        ]
      },
      "ui_hint": "radio"
    },
    {
      "path": "/construction/packaging-design",
      "title": "Packaging Design",
      "default_unit": {
        "slug": "assessment",
        "title": "assessments",
        "system": "enum",
        "choices": [
          {
            "rank": 1,
            "text": "mostly-yes",
            "descr": "Mostly yes"
          },
          {
            "rank": 2,
            "text": "yes",
            "descr": "Yes"
          },
          {
            "rank": 3,
            "text": "no",
            "descr": "No"
          },
          {
            "rank": 4,
            "text": "mostly-no",
            "descr": "Mostly no"
          }
        ]
      },
      "ui_hint": "radio"
    }
  ]
}

Deletes a campaign

endpoint
DELETE /api/{profile}/campaigns/{campaign}

Removes a Campaign and all associated Sample. The underlying Answer that were grouped in a Sample remain present in the database. These Answer are just no longer grouped logically in a Sample.

Responses

204 No Content

 

Examples
curl -X DELETE http://localhost:8040/api/alliance/campaign/sustainability

Lists fitlers

endpoint
GET /api/{profile}/filters
Query parameters
page
integer

A page number within the paginated result set.

q
string

A search term.

o
string

Which field to use when ordering the results.

Responses
count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

slug
string

title
string

Title for the filter

extra
string

Extra meta data (can be stringify JSON)

predicates
array

rank
integer

operator
string

operand
string

field
string

selector
string

likely_metric
string

results
array

slug
string

printable_name
string

Name that can be safely used for display in HTML pages

picture
string

URL location of the profile picture

extra
string

Extra meta data (can be stringify JSON)

rank
string

rank in filter

 

Examples
curl http://localhost:8040/api/energy-utility/filters
responds
{
  "count": 2,
  "next": null,
  "previous": null,
  "results": [
    {
      "slug": "boxes-and-enclosures",
      "title": "Boxes & enclosures",
      "extra": "",
      "predicates": [
        {
          "rank": 0,
          "operator": "startswith",
          "operand": "/metal/boxes-and-enclosures",
          "field": "extra",
          "selector": "keepmatching"
        }
      ],
      "likely_metric": null
    }
  ]
}

Lists profiles filters

endpoint
GET /api/{profile}/filters/accounts
Query parameters
page
integer

A page number within the paginated result set.

Responses
count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

slug
string

title
string

Title for the filter

extra
string

Extra meta data (can be stringify JSON)

predicates
array

rank
integer

operator
string

operand
string

field
string

selector
string

likely_metric
string

results
array

slug
string

printable_name
string

Name that can be safely used for display in HTML pages

picture
string

URL location of the profile picture

extra
string

Extra meta data (can be stringify JSON)

rank
string

rank in filter

 

Examples
curl http://localhost:8040/api/supplier-1/filters/accounts
responds
{
  "count": 1,
  "previous": null,
  "next": null,
  "results": [
    {
      "slug": "supplier-1",
      "title": "Supplier 1",
      "extra": null,
      "predicates": [],
      "likely_metric": [],
      "results": []
    }
  ]
}

Creates a profiles fitler

endpoint
POST /api/{profile}/filters/accounts
Request body
slug
string

title
string required

Title for the filter

extra
string

Extra meta data (can be stringify JSON)

predicates
array

rank
integer

operator
string required

operand
string required

field
string required

selector
string required

results
array

Responses
slug
string

title
string

Title for the filter

extra
string

Extra meta data (can be stringify JSON)

predicates
array

rank
integer

operator
string

operand
string

field
string

selector
string

likely_metric
string

results
array

slug
string

printable_name
string

Name that can be safely used for display in HTML pages

picture
string

URL location of the profile picture

extra
string

Extra meta data (can be stringify JSON)

rank
string

rank in filter

 

Examples
curl -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{"title": "Supplier 1"}' http://localhost:8040/api/energy-utility/filters/accounts
responds
{
  "slug": "supplier-1",
  "title": "Supplier 1",
  "extra": null,
  "predicates": [],
  "likely_metric": [],
  "results": []
}

Lists values in an account

endpoint
GET /api/{profile}/filters/accounts/values
Query parameters
page
integer

A page number within the paginated result set.

start_at
string

date/time in ISO format

ends_at
string

date/time in ISO format

Responses
count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

unit
string

Unit the measured field is in

measured
string

measurement in unit

created_at
string

Date/time of creation (in ISO format)

collected_by
string

User that collected the answer

account
string

 

Examples
curl http://localhost:8040/api/supplier-1/filters/accounts/values
responds
{
  "count": 0,
  "next": null,
  "previous": null,
  "results": [
    {
      "created_at": "2020-01-01T00:00:00Z",
      "measured": 12,
      "unit": "tons"
    }
  ]
}

Retrieves a profiles fitler

endpoint
GET /api/{profile}/filters/accounts/{editable_filter}
Responses
slug
string

title
string

Title for the filter

extra
string

Extra meta data (can be stringify JSON)

predicates
array

rank
integer

operator
string

operand
string

field
string

selector
string

likely_metric
string

results
array

slug
string

printable_name
string

Name that can be safely used for display in HTML pages

picture
string

URL location of the profile picture

extra
string

Extra meta data (can be stringify JSON)

rank
string

rank in filter

 

Examples
curl http://localhost:8040/api/energy-utility/filters/accounts/suppliers
responds
{
  "slug": "suppliers",
  "title": "Energy utility suppliers",
  "extra": null,
  "predicates": [],
  "likely_metric": null,
  "results": [
    {
      "facility": "Main factory",
      "fuel_type": "natural-gas",
      "allocation": "Energy utility",
      "created_at": null,
      "ends_at": null,
      "amount": 100,
      "unit": "mmbtu"
    }
  ]
}

Updates a profiles fitler

endpoint
POST /api/{profile}/filters/accounts/{editable_filter}
Request body
slug
string

full_name
string required

extra
string

Extra meta data (can be stringify JSON)

Responses
slug
string

full_name
string

extra
string

Extra meta data (can be stringify JSON)

 

Examples
curl -X PUT -H 'Content-Type: application/json; charset=UTF-8' -d '{"full_name": "Main"}' http://localhost:8040/api/energy-utility/filters/accounts/suppliers
responds
{
  "slug": "main",
  "full_name": "Main"
}

Updates a fitler

endpoint
PUT /api/{profile}/filters/accounts/{editable_filter}
Request body
slug
string

title
string required

Title for the filter

extra
string

Extra meta data (can be stringify JSON)

predicates
array

rank
integer

operator
string required

operand
string required

field
string required

selector
string required

results
array

Responses
slug
string

title
string

Title for the filter

extra
string

Extra meta data (can be stringify JSON)

predicates
array

rank
integer

operator
string

operand
string

field
string

selector
string

likely_metric
string

results
array

slug
string

printable_name
string

Name that can be safely used for display in HTML pages

picture
string

URL location of the profile picture

extra
string

Extra meta data (can be stringify JSON)

rank
string

rank in filter

 

Examples
curl -X PUT -H 'Content-Type: application/json; charset=UTF-8' -d '{"title": "Energy utility suppliers", "predicates": []}' http://localhost:8040/api/energy-utility/filters/accounts/suppliers
responds
{
  "slug": "suppliers",
  "title": "Energy utility suppliers",
  "extra": null,
  "predicates": [],
  "likely_metric": null,
  "results": [
    {
      "facility": "Main factory",
      "fuel_type": "natural-gas",
      "allocation": "Energy utility",
      "created_at": null,
      "ends_at": null,
      "amount": 100,
      "unit": "mmbtu"
    }
  ]
}

Deletes a profiles fitler

endpoint
DELETE /api/{profile}/filters/accounts/{editable_filter}
Responses

204 No Content

 

Examples
curl -X DELETE http://localhost:8040/api/energy-utility/filters/accounts/suppliers

Lists quantitative measurements

endpoint
GET /api/{profile}/filters/accounts/{editable_filter}/values
Query parameters
page
integer

A page number within the paginated result set.

start_at
string

date/time in ISO format

ends_at
string

date/time in ISO format

Responses
count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

unit
string

Unit the measured field is in

measured
string

measurement in unit

created_at
string

Date/time of creation (in ISO format)

collected_by
string

User that collected the answer

 

Examples
curl http://localhost:8040/api/supplier-1/filters/accounts/ghg-emissions/values
responds
{
  "count": 0,
  "next": null,
  "previous": null,
  "results": [
    {
      "created_at": "2020-01-01T00:00:00Z",
      "measured": 12,
      "unit": "tons"
    }
  ]
}

Records quantitative measurements

endpoint
POST /api/{profile}/filters/accounts/{editable_filter}/values

Records numeric measurements towards a specific metric.

When baseline_at is specified, the measurement refers to a relative value since baseline_at. When baseline_at is not specified, the intent is to record an absolute measurement at time created_at.

Request body
baseline_at
string

created_at
string required

items
array required

unit
string required

Unit the measured field is in

measured
string required

measurement in unit

slug
string required

Account this sample belongs to.

Responses
baseline_at
string

created_at
string

items
array

unit
string

Unit the measured field is in

measured
string

measurement in unit

created_at
string

Date/time of creation (in ISO format)

collected_by
string

User that collected the answer

slug
string

Account this sample belongs to.

 

Examples
curl -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{"created_at": "2020-01-01T00:00:00Z", "items": [{"slug": "main-factory", "measured": 12, "unit": "tons"}]}' http://localhost:8040/api/supplier-1/filters/accounts/ghg-emissions/values
responds
{
  "created_at": "2020-01-01T00:00:00Z",
  "items": [
    {
      "slug": "main-factory",
      "measured": 12,
      "unit": "tons"
    }
  ]
}

Retrieves a profile in an enumerated profiles filter

endpoint
GET /api/{profile}/filters/accounts/{editable_filter}/{rank}
Responses
slug
string

full_name
string

extra
string

Extra meta data (can be stringify JSON)

 

Examples
curl http://localhost:8040/api/energy-utility/filters/accounts/suppliers/1
responds
{
  "slug": "main-factory",
  "full_name": "Main factory"
}

Updates a profile in an enumerated profiles filter

endpoint
PUT /api/{profile}/filters/accounts/{editable_filter}/{rank}
Request body
slug
string

full_name
string required

extra
string

Extra meta data (can be stringify JSON)

Responses
slug
string

full_name
string

extra
string

Extra meta data (can be stringify JSON)

 

Examples
curl -X PUT -H 'Content-Type: application/json; charset=UTF-8' -d '{"full_name": "Main factory"}' http://localhost:8040/api/energy-utility/filters/accounts/suppliers/1
responds
{
  "slug": "main-factory",
  "full_name": "Main factory"
}

Deletes a profile in an enumerated profiles filter

endpoint
DELETE /api/{profile}/filters/accounts/{editable_filter}/{rank}
Responses

204 No Content

 

Examples
curl -X DELETE http://localhost:8040/api/energy-utility/filters/accounts/suppliers/1

Lists questions filters

endpoint
GET /api/{profile}/filters/questions
Query parameters
page
integer

A page number within the paginated result set.

Responses
count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

title
string

Title of the question as displayed in user interfaces

text
string

Long form description about the question

default_unit
string

Default unit for measured field when none is specified

extra
string

Extra meta data (can be stringify JSON)

path
string

Unique identifier that can be used in URL

 

Examples
curl http://localhost:8040/api/supplier-1/filters/questions
responds
{
  "count": 1,
  "previous": null,
  "next": null,
  "results": [
    {
      "path": "/construction/product-design",
      "title": "Product Design",
      "default_unit": "assessment",
      "ui_hint": "radio"
    }
  ]
}

Creates a questions fitler

endpoint
POST /api/{profile}/filters/questions
Request body
title
string

Title of the question as displayed in user interfaces

text
string

Long form description about the question

default_unit
string required

Default unit for measured field when none is specified

extra
string

Extra meta data (can be stringify JSON)

Responses
title
string

Title of the question as displayed in user interfaces

text
string

Long form description about the question

default_unit
string

Default unit for measured field when none is specified

extra
string

Extra meta data (can be stringify JSON)

path
string

Unique identifier that can be used in URL

 

Examples
curl -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{"title": "Construction", "default_unit": "assessment", "path": "/construction/product-design"}' http://localhost:8040/api/energy-utility/filters/questions
responds
{
  "title": "Construction",
  "default_unit": "assessment",
  "path": "/construction/product-design"
}

Retrieves a questions fitler

endpoint
GET /api/{profile}/filters/questions/{editable_filter}
Responses
slug
string

title
string

Title for the filter

extra
string

Extra meta data (can be stringify JSON)

predicates
array

rank
integer

operator
string

operand
string

field
string

selector
string

likely_metric
string

results
array

slug
string

printable_name
string

Name that can be safely used for display in HTML pages

picture
string

URL location of the profile picture

extra
string

Extra meta data (can be stringify JSON)

rank
string

rank in filter

 

Examples
curl http://localhost:8040/api/energy-utility/filters/questions/governance
responds
{
  "slug": "governance",
  "title": "Governance questions",
  "predicates": [
    {
      "rank": 1,
      "operator": "contains",
      "operand": "Energy",
      "field": "extra",
      "selector": "keepmatching"
    }
  ]
}

Updates a questions fitler

endpoint
PUT /api/{profile}/filters/questions/{editable_filter}
Request body
slug
string

title
string required

Title for the filter

extra
string

Extra meta data (can be stringify JSON)

predicates
array

rank
integer

operator
string required

operand
string required

field
string required

selector
string required

results
array

Responses
slug
string

title
string

Title for the filter

extra
string

Extra meta data (can be stringify JSON)

predicates
array

rank
integer

operator
string

operand
string

field
string

selector
string

likely_metric
string

results
array

slug
string

printable_name
string

Name that can be safely used for display in HTML pages

picture
string

URL location of the profile picture

extra
string

Extra meta data (can be stringify JSON)

rank
string

rank in filter

 

Examples
curl -X PUT -H 'Content-Type: application/json; charset=UTF-8' -d '{"slug": "governance", "title": "Governance questions", "predicates": [{"rank": 1, "operator": "contains", "operand": "Energy", "field": "extra", "selector": "keepmatching"}]}' http://localhost:8040/api/energy-utility/filters/questions/governance
responds
{
  "slug": "governance",
  "title": "Governance questions",
  "predicates": [
    {
      "rank": 1,
      "operator": "contains",
      "operand": "Energy",
      "field": "extra",
      "selector": "keepmatching"
    }
  ]
}

Deletes a questions fitler

endpoint
DELETE /api/{profile}/filters/questions/{editable_filter}
Responses

204 No Content

 

Examples
curl -X DELETE http://localhost:8040/api/energy-utility/filters/questions/governance

Retrieves aggregated metric over a time period

endpoint
GET /api/{profile}/metrics/aggregate/{path}
Query parameters
start_at
string

date/time in ISO format

ends_at
string

date/time in ISO format

Responses
unit
string

Unit the measured field is in

measured
string

measurement in unit

created_at
string

Date/time of creation (in ISO format)

collected_by
string

User that collected the answer

 

Examples
curl http://localhost:8040/api/supplier-1/metrics/aggregate/ghg-emissions
responds
{
  "created_at": "2020-01-01T00:00:00Z",
  "measured": 12,
  "unit": "tons"
}

Lists active grants and requests

endpoint
GET /api/{profile}/portfolios

Lists all grants and requests that have to be accepted or denied by account.

If you want to get all requests that have been initiated by account, see /api/{account}/requests. If you want to get all grants that have been initiated account, see /api/{account}/grants.

Query parameters
page
integer

A page number within the paginated result set.

state
string

filter by state (grant-initiated, grant-accepted, grant-denied, grant-expired, request-initiated, request-accepted, request-denied, request-expired)

start_at
string

date/time in ISO format

ends_at
string

date/time in ISO format

q
string

value to search for in the fields specified by q_f

q_f
string

restrict searches to one or more fields in: grantee__full_name, account__full_name. searches all fields when unspecified.

o
string

sort by grantee, account, state, ends_at. If a field is preceded by a minus sign ('-'), the order will be reversed. Multiple 'o' parameters can be specified to produce a stable result.

Responses
count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

grantee
string

account
string

campaign
object

Campaign granted/requested

slug
string

Unique identifier that can be used in a URL

account
string

Account this sample belongs to.

title
string

Title of the campaign as displayed in user interfaces

description
string

Long form description displayed to users responding to the campaign

created_at
string

active
boolean

Whether the campaign is available or not

created_at
string

Date/time at which the grant/request was created

ends_at
string

state
string

expected_behavior
string

api_accept
string

api_remove
string

 

Examples
curl http://localhost:8040/api/energy-utility/portfolios
responds
{
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
    {
      "grantee": "energy-utility",
      "account": "supplier-1",
      "campaign": {
        "slug": "sustainability",
        "title": "ESG/Environmental practices",
        "account": "tspproject"
      },
      "ends_at": "2022-01-01T00:00:00Z",
      "state": "request-initiated",
      "api_accept": "/api/supplier-1/portfolios/requests/0000000000000000000000000000000000000002/"
    }
  ]
}

Lists initiated grants

endpoint
GET /api/{profile}/portfolios/grants

Lists all grants currently pending initiated by account.

Query parameters
page
integer

A page number within the paginated result set.

state
string

filter by state (grant-initiated, grant-accepted, grant-denied, grant-expired, request-initiated, request-accepted, request-denied, request-expired)

start_at
string

date/time in ISO format

ends_at
string

date/time in ISO format

q
string

value to search for in the fields specified by q_f

q_f
string

restrict searches to one or more fields in: grantee__full_name, account__full_name. searches all fields when unspecified.

o
string

sort by grantee, account, state, ends_at. If a field is preceded by a minus sign ('-'), the order will be reversed. Multiple 'o' parameters can be specified to produce a stable result.

Responses
count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

grantee
string

account
string

campaign
object

Campaign granted/requested

slug
string

Unique identifier that can be used in a URL

account
string

Account this sample belongs to.

title
string

Title of the campaign as displayed in user interfaces

description
string

Long form description displayed to users responding to the campaign

created_at
string

active
boolean

Whether the campaign is available or not

created_at
string

Date/time at which the grant/request was created

ends_at
string

state
string

expected_behavior
string

api_accept
string

api_remove
string

extra
string

Extra meta data (can be stringify JSON)

 

Examples
curl http://localhost:8040/api/supplier-1/portfolios/grants
responds
{
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
    {
      "grantee": "water-utility",
      "account": "supplier-1",
      "campaign": {
        "slug": "sustainability",
        "title": "ESG/Environmental practices",
        "account": "tspproject"
      },
      "ends_at": "2022-01-01T00:00:00Z",
      "state": "grant-initiated",
      "api_accept": "/api/water-utility/portfolios/grants/0000000000000000000000000000000000000003/"
    }
  ]
}

Initiates grant

endpoint
POST /api/{profile}/portfolios/grants

Initiate a grant of data to a grantee

Request body
accounts
array

campaign
string

message
string

grantee
object required

slug
string required

full_name
string required

email
string

Responses
count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

grantee
string

account
string

campaign
object

Campaign granted/requested

slug
string

Unique identifier that can be used in a URL

account
string

Account this sample belongs to.

title
string

Title of the campaign as displayed in user interfaces

description
string

Long form description displayed to users responding to the campaign

created_at
string

active
boolean

Whether the campaign is available or not

created_at
string

Date/time at which the grant/request was created

ends_at
string

state
string

expected_behavior
string

api_accept
string

api_remove
string

extra
string

Extra meta data (can be stringify JSON)

 

Examples
curl -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{"grantee": {"slug": "energy-utility", "full_name": "Energy Utility"}}' http://localhost:8040/api/supplier-1/portfolios/grants
responds
{
  "count": 1,
  "results": [
    {
      "grantee": "water-utility",
      "account": "supplier-1",
      "campaign": null,
      "ends_at": "2022-01-01T00:00:00Z",
      "state": "grant-initiated",
      "api_accept": "/api/water-utility/portfolios/grants/0000000000000000000000000000000000000003/"
    }
  ]
}

Accepts grant

endpoint
POST /api/{profile}/portfolios/grants/{verification_key}

An account has sent its portfolio to a grantee. The grantee accepts the request, making the account's answers up-to-date ends_at available to grantee.

Note that account parameter is the grantee we have send data to here, while the account parameter is the account owning that data when calling POST /api/{account}/grants.

Responses

200

 

Examples
curl -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{}' http://localhost:8040/api/energy-utility/portfolios/grants/0123456789abcef
responds
{}

Ignores grant

endpoint
DELETE /api/{profile}/portfolios/grants/{verification_key}
Responses

204 No Content

 

Examples
curl -X DELETE http://localhost:8040/api/energy-utility/portfolios/grants/0123456789abcef

Lists initiated requests

endpoint
GET /api/{profile}/portfolios/requests

Lists all requests currently pending initiated by account.

Query parameters
page
integer

A page number within the paginated result set.

state
string

filter by state (grant-initiated, grant-accepted, grant-denied, grant-expired, request-initiated, request-accepted, request-denied, request-expired)

start_at
string

date/time in ISO format

ends_at
string

date/time in ISO format

q
string

value to search for in the fields specified by q_f

q_f
string

restrict searches to one or more fields in: grantee__full_name, account__full_name. searches all fields when unspecified.

o
string

sort by grantee, account, state, ends_at. If a field is preceded by a minus sign ('-'), the order will be reversed. Multiple 'o' parameters can be specified to produce a stable result.

Responses
count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

grantee
string

account
string

campaign
object

Campaign granted/requested

slug
string

Unique identifier that can be used in a URL

account
string

Account this sample belongs to.

title
string

Title of the campaign as displayed in user interfaces

description
string

Long form description displayed to users responding to the campaign

created_at
string

active
boolean

Whether the campaign is available or not

created_at
string

Date/time at which the grant/request was created

ends_at
string

state
string

expected_behavior
string

api_accept
string

api_remove
string

extra
string

Extra meta data (can be stringify JSON)

 

Examples
curl http://localhost:8040/api/energy-utility/portfolios/requests
responds
{
  "count": 3,
  "next": null,
  "previous": null,
  "results": [
    {
      "grantee": "energy-utility",
      "account": "supplier-1",
      "campaign": {
        "slug": "sustainability",
        "title": "ESG/Environmental practices",
        "account": "tspproject"
      },
      "ends_at": "2022-01-01T00:00:00Z",
      "state": "request-denied",
      "api_accept": null
    },
    {
      "grantee": "energy-utility",
      "account": "supplier-1",
      "campaign": {
        "slug": "sustainability",
        "title": "ESG/Environmental practices",
        "account": "tspproject"
      },
      "ends_at": "2022-01-01T00:00:00Z",
      "state": "request-initiated",
      "api_accept": "/api/supplier-1/portfolios/requests/0000000000000000000000000000000000000002/"
    },
    {
      "grantee": "energy-utility",
      "account": "andy-shop",
      "campaign": {
        "slug": "sustainability",
        "title": "ESG/Environmental practices",
        "account": "tspproject"
      },
      "ends_at": "2022-01-01T00:00:00Z",
      "state": "request-initiated",
      "api_accept": "/api/andy-shop/portfolios/requests/0000000000000000000000000000000000000004/"
    }
  ]
}

Initiates request

endpoint
POST /api/{profile}/portfolios/requests

Initiate a request of data for an account.

Request body
accounts
array required

slug
string required

full_name
string required

email
string

campaign
string

message
string

extra
string

Extra meta data (can be stringify JSON)

Responses
accounts
array

slug
string

full_name
string

email
string

printable_name
string

campaign
string

message
string

ends_at
string

extra
string

Extra meta data (can be stringify JSON)

 

Examples
curl -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{"accounts": [{"slug": "supplier-1", "full_name": "Supplier 1"}]}' http://localhost:8040/api/energy-utility/portfolios/requests
responds
{
  "accounts": [
    {
      "slug": "supplier-1",
      "full_name": "Supplier 1"
    }
  ]
}

Updates extra field in a request/grant

endpoint
PUT /api/{profile}/portfolios/requests/metadata/{target}

The requestor/grantor uses this API call to add metadata about the request/grant.

Request body
extra
string

Extra meta data (can be stringify JSON)

Responses
grantee
string

account
string

campaign
object

Campaign granted/requested

slug
string

Unique identifier that can be used in a URL

account
string

Account this sample belongs to.

title
string

Title of the campaign as displayed in user interfaces

description
string

Long form description displayed to users responding to the campaign

created_at
string

active
boolean

Whether the campaign is available or not

created_at
string

Date/time at which the grant/request was created

ends_at
string

state
string

expected_behavior
string

api_accept
string

api_remove
string

extra
string

Extra meta data (can be stringify JSON)

 

Examples
curl -X PUT -H 'Content-Type: application/json; charset=UTF-8' -d '{"extra": {"tags": "tier1"}}' http://localhost:8040/api/energy-utility/portfolios/requests/metadata/supplier-1
responds
{
  "grantee": "energy-utility",
  "account": "supplier-1",
  "campaign": {
    "slug": "sustainability",
    "title": "ESG/Environmental practices",
    "account": "tspproject"
  },
  "ends_at": "2022-01-01T00:00:00Z",
  "state": "request-denied",
  "api_accept": null,
  "extra": {
    "tags": "tier1"
  }
}

Accepts request

endpoint
POST /api/{profile}/portfolios/requests/{verification_key}

A grantee has made a request to account's portfolio. The account accepts the request, making the account's answers up-to-date ends_at available to grantee.

Note that account is the actual account we are looking to access data from here, while the account parameter is the grantee when calling POST /api/{account}/requests.

Responses

200

 

Examples
curl -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{}' http://localhost:8040/api/supplier-1/portfolios/requests/0123456789abcef
responds
{}

Ignores request

endpoint
DELETE /api/{profile}/portfolios/requests/{verification_key}
Responses

204 No Content

 

Examples
curl -X DELETE http://localhost:8040/api/supplier-1/portfolios/requests/0123456789abcef

Lists accessible samples by year

endpoint
GET /api/{profile}/reporting/{campaign}/accessibles

Lists year-by-year accessible responses for reporting profiles

Query parameters
page
integer

A page number within the paginated result set.

q
string

value to search for in the fields specified by q_f

q_f
string

restrict searches to one or more fields in: slug, full_name, email. searches all fields when unspecified.

o
string

sort by created_at, full_name. If a field is preceded by a minus sign ('-'), the order will be reversed. Multiple 'o' parameters can be specified to produce a stable result.

Responses
count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

slug
string

Unique key in the table for the data series

title
string

Title of data serie that can be safely used for display in HTML pages

extra
string

Extra meta data (can be stringify JSON)

values
array

Datapoints in the serie

printable_name
string

Title of data serie that can be safely used for display in HTML pages

 

Examples
curl http://localhost:8040/api/energy-utility/reporting/sustainability/accessibles
responds
{
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
    {
      "slug": "andy-shop",
      "printable_name": "Andy's Shop",
      "values": [
        [
          "2023-01-01T00:00:00Z",
          "complete",
          95
        ],
        [
          "2022-01-01T00:00:00Z",
          "complete",
          95
        ],
        [
          "2021-01-01T00:00:00Z",
          "declined",
          null
        ],
        [
          "2020-01-01T00:00:00Z",
          "no-data",
          null
        ],
        [
          "2019-01-01T00:00:00Z",
          "no-data",
          null
        ],
        [
          "2018-01-01T00:00:00Z",
          "no-data",
          null
        ]
      ]
    },
    {
      "slug": "supplier-1",
      "printable_name": "Supplier 1",
      "values": [
        [
          "2023-01-01T00:00:00Z",
          "complete",
          82
        ],
        [
          "2022-01-01T00:00:00Z",
          "complete",
          82
        ],
        [
          "2021-01-01T00:00:00Z",
          "declined",
          null
        ],
        [
          "2020-01-01T00:00:00Z",
          "no-data",
          null
        ],
        [
          "2019-01-01T00:00:00Z",
          "no-data",
          null
        ],
        [
          "2018-01-01T00:00:00Z",
          "no-data",
          null
        ]
      ]
    }
  ]
}

Retrieves assessments completed by segments

endpoint
GET /api/{profile}/reporting/{campaign}/by-segments

Returns the number of reporting accounts aggregated by segments.

Responses
scale
number

The scale of the number reported in the tables (ex: 1000 when numbers are reported in thousands)

unit
string

Unit the measured field is in

title
string

Title for the table

results
array

Data series

slug
string

Unique key in the table for the data series

title
string

Title of data serie that can be safely used for display in HTML pages

extra
string

Extra meta data (can be stringify JSON)

values
array

Datapoints in the serie

 

Examples
curl http://localhost:8040/api/energy-utility/reporting/sustainability/by-segments
responds
{
  "title": "Assessments completed by segments",
  "scale": 1,
  "unit": "profiles",
  "results": [
    {
      "slug": "energy-utility",
      "values": []
    },
    {
      "slug": "alliance",
      "values": []
    }
  ]
}

Compares answers

endpoint
GET /api/{profile}/reporting/{campaign}/compare
Query parameters
page
integer

A page number within the paginated result set.

Responses
count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

slug
string

Unique identifier that can be used in URL paths

path
string

path from the root of content tree

indent
string

level in the content tree

account
string

Account that can edit the page element

title
string

Title of the page element

picture
string

Picture icon that can be displayed alongside the title

extra
string

Extra meta data (can be stringify JSON)

default_unit
string

score_weight
string

values
array

 

Examples
curl http://localhost:8040/api/energy-utility/reporting/sustainability/compare
responds
{
  "count": 4,
  "results": [
    {
      "count": 1,
      "slug": "sustainability",
      "path": "/sustainability",
      "indent": 0,
      "title": "Core Environment, Social and Governance (ESG) Assessment",
      "picture": null,
      "extra": {
        "pagebreak": true,
        "tags": [
          "scorecard"
        ],
        "visibility": [
          "public"
        ],
        "segments": [
          "/sustainability"
        ]
      },
      "rank": -1,
      "required": false,
      "default_unit": null,
      "ui_hint": null,
      "nb_respondents": 0,
      "rate": {},
      "opportunity": null
    },
    {
      "count": 1,
      "slug": "governance",
      "path": "/sustainability/governance",
      "indent": 1,
      "title": "Strategy & Governance",
      "picture": "/tspproject/static/img/management-basics.png",
      "extra": {
        "segments": [
          "/sustainability"
        ]
      },
      "rank": 1,
      "required": false,
      "default_unit": null,
      "ui_hint": null,
      "nb_respondents": 0,
      "rate": {},
      "opportunity": null
    },
    {
      "count": 1,
      "slug": "esg-strategy-heading",
      "path": "/sustainability/governance/esg-strategy-heading",
      "indent": 2,
      "title": "Environment, Social & Governance (ESG) Strategy",
      "picture": null,
      "extra": {
        "segments": [
          "/sustainability"
        ]
      },
      "rank": 1,
      "required": false,
      "default_unit": null,
      "ui_hint": null,
      "nb_respondents": 0,
      "rate": {},
      "opportunity": null
    },
    {
      "count": 1,
      "slug": "formalized-esg-strategy",
      "path": "/sustainability/governance/esg-strategy-heading/formalized-esg-strategy",
      "indent": 3,
      "title": "(3) Does your company have a formalized ESG strategy?",
      "picture": "/tspproject/static/img/management-basics.png",
      "extra": {
        "segments": [
          "/sustainability"
        ]
      },
      "rank": 4,
      "required": true,
      "default_unit": {
        "slug": "yes-no",
        "title": "Yes/No",
        "system": "enum",
        "choices": [
          {
            "text": "Yes",
            "descr": "Yes"
          },
          {
            "text": "No",
            "descr": "No"
          }
        ]
      },
      "ui_hint": "yes-no-comments",
      "answers": [
        {
          "measured": "true"
        },
        {
          "measured": "false"
        }
      ],
      "candidates": [],
      "planned": [],
      "nb_respondents": 0,
      "rate": {},
      "opportunity": null
    }
  ]
}

Compares answers matching prefix

endpoint
GET /api/{profile}/reporting/{campaign}/compare/{path}
Responses
count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

slug
string

Unique identifier that can be used in URL paths

path
string

path from the root of content tree

indent
string

level in the content tree

account
string

Account that can edit the page element

title
string

Title of the page element

picture
string

Picture icon that can be displayed alongside the title

extra
string

Extra meta data (can be stringify JSON)

default_unit
string

score_weight
string

values
array

 

Examples
curl http://localhost:8040/api/energy-utility/reporting/sustainability/compare/sustainability
responds
{
  "count": 4,
  "results": [
    {
      "count": 1,
      "slug": "sustainability",
      "path": "/sustainability",
      "indent": 0,
      "title": "Core Environment, Social and Governance (ESG) Assessment",
      "picture": null,
      "extra": {
        "pagebreak": true,
        "tags": [
          "scorecard"
        ],
        "visibility": [
          "public"
        ],
        "segments": [
          "/sustainability"
        ]
      },
      "rank": -1,
      "required": false,
      "default_unit": null,
      "ui_hint": null,
      "nb_respondents": 0,
      "rate": {},
      "opportunity": null
    },
    {
      "count": 1,
      "slug": "governance",
      "path": "/sustainability/governance",
      "indent": 1,
      "title": "Strategy & Governance",
      "picture": "/tspproject/static/img/management-basics.png",
      "extra": {
        "segments": [
          "/sustainability"
        ]
      },
      "rank": 1,
      "required": false,
      "default_unit": null,
      "ui_hint": null,
      "nb_respondents": 0,
      "rate": {},
      "opportunity": null
    },
    {
      "count": 1,
      "slug": "esg-strategy-heading",
      "path": "/sustainability/governance/esg-strategy-heading",
      "indent": 2,
      "title": "Environment, Social & Governance (ESG) Strategy",
      "picture": null,
      "extra": {
        "segments": [
          "/sustainability"
        ]
      },
      "rank": 1,
      "required": false,
      "default_unit": null,
      "ui_hint": null,
      "nb_respondents": 0,
      "rate": {},
      "opportunity": null
    },
    {
      "count": 1,
      "slug": "formalized-esg-strategy",
      "path": "/sustainability/governance/esg-strategy-heading/formalized-esg-strategy",
      "indent": 3,
      "title": "(3) Does your company have a formalized ESG strategy?",
      "picture": "/tspproject/static/img/management-basics.png",
      "extra": {
        "segments": [
          "/sustainability"
        ]
      },
      "rank": 4,
      "required": true,
      "default_unit": {
        "slug": "yes-no",
        "title": "Yes/No",
        "system": "enum",
        "choices": [
          {
            "text": "Yes",
            "descr": "Yes"
          },
          {
            "text": "No",
            "descr": "No"
          }
        ]
      },
      "ui_hint": "yes-no-comments",
      "answers": [
        {
          "measured": "true"
        },
        {
          "measured": "false"
        }
      ],
      "candidates": [],
      "planned": [],
      "nb_respondents": 0,
      "rate": {},
      "opportunity": null
    }
  ]
}

Retrieves the completion rate

endpoint
GET /api/{profile}/reporting/{campaign}/completion-rate

Returns the week-by-week percentage of requested accounts that have completed a scorecard.

Responses
scale
number

The scale of the number reported in the tables (ex: 1000 when numbers are reported in thousands)

unit
string

Unit the measured field is in

title
string

Title for the table

results
array

Data series

slug
string

Unique key in the table for the data series

title
string

Title of data serie that can be safely used for display in HTML pages

extra
string

Extra meta data (can be stringify JSON)

values
array

Datapoints in the serie

 

Examples
curl http://localhost:8040/api/energy-utility/reporting/sustainability/completion-rate
responds
{
  "title": "Completion rate (%)",
  "scale": 1,
  "unit": "percentage",
  "results": [
    {
      "slug": "completion-rate",
      "printable_name": "% completion",
      "values": [
        [
          "2020-09-13T00:00:00Z",
          0
        ],
        [
          "2020-09-20T00:00:00Z",
          0
        ],
        [
          "2020-09-27T00:00:00Z",
          0
        ],
        [
          "2020-10-04T00:00:00Z",
          0
        ],
        [
          "2020-10-11T00:00:00Z",
          0
        ],
        [
          "2020-10-18T00:00:00Z",
          0
        ],
        [
          "2020-10-25T00:00:00Z",
          0
        ],
        [
          "2020-11-01T00:00:00Z",
          0
        ],
        [
          "2020-11-08T00:00:00Z",
          0
        ],
        [
          "2020-11-15T00:00:00Z",
          0
        ],
        [
          "2020-11-22T00:00:00Z",
          0
        ],
        [
          "2020-11-29T00:00:00Z",
          0
        ],
        [
          "2020-12-06T00:00:00Z",
          0
        ],
        [
          "2020-12-13T00:00:00Z",
          0
        ],
        [
          "2020-12-20T00:00:00Z",
          0
        ],
        [
          "2020-12-27T00:00:00Z",
          0
        ],
        [
          "2021-01-03T00:00:00Z",
          0
        ]
      ]
    },
    {
      "slug": "last-year",
      "printable_name": "vs. last year",
      "values": [
        [
          "2019-09-15T00:00:00Z",
          0
        ],
        [
          "2019-09-22T00:00:00Z",
          0
        ],
        [
          "2019-09-29T00:00:00Z",
          0
        ],
        [
          "2019-10-06T00:00:00Z",
          0
        ],
        [
          "2019-10-13T00:00:00Z",
          0
        ],
        [
          "2019-10-20T00:00:00Z",
          0
        ],
        [
          "2019-10-27T00:00:00Z",
          0
        ],
        [
          "2019-11-03T00:00:00Z",
          0
        ],
        [
          "2019-11-10T00:00:00Z",
          0
        ],
        [
          "2019-11-17T00:00:00Z",
          0
        ],
        [
          "2019-11-24T00:00:00Z",
          0
        ],
        [
          "2019-12-01T00:00:00Z",
          0
        ],
        [
          "2019-12-08T00:00:00Z",
          0
        ],
        [
          "2019-12-15T00:00:00Z",
          0
        ],
        [
          "2019-12-22T00:00:00Z",
          0
        ],
        [
          "2019-12-29T00:00:00Z",
          0
        ],
        [
          "2020-01-05T00:00:00Z",
          0
        ]
      ]
    },
    {
      "slug": "alliance",
      "printable_name": "Alliance",
      "values": [
        [
          "2020-09-13T00:00:00Z",
          0
        ],
        [
          "2020-09-20T00:00:00Z",
          0
        ],
        [
          "2020-09-27T00:00:00Z",
          0
        ],
        [
          "2020-10-04T00:00:00Z",
          0
        ],
        [
          "2020-10-11T00:00:00Z",
          0
        ],
        [
          "2020-10-18T00:00:00Z",
          0
        ],
        [
          "2020-10-25T00:00:00Z",
          0
        ],
        [
          "2020-11-01T00:00:00Z",
          0
        ],
        [
          "2020-11-08T00:00:00Z",
          0
        ],
        [
          "2020-11-15T00:00:00Z",
          0
        ],
        [
          "2020-11-22T00:00:00Z",
          0
        ],
        [
          "2020-11-29T00:00:00Z",
          0
        ],
        [
          "2020-12-06T00:00:00Z",
          0
        ],
        [
          "2020-12-13T00:00:00Z",
          0
        ],
        [
          "2020-12-20T00:00:00Z",
          0
        ],
        [
          "2020-12-27T00:00:00Z",
          0
        ],
        [
          "2021-01-03T00:00:00Z",
          0
        ]
      ]
    }
  ]
}

Lists engagement for reporting profiles

endpoint
GET /api/{profile}/reporting/{campaign}/engagement

reporting_status can be one of: - invited - updated / work-in-progress - completed - declined (to respond) - completed declined to share

Query parameters
page
integer

A page number within the paginated result set.

q
string

value to search for in the fields specified by q_f

q_f
string

restrict searches to one or more fields in: slug, full_name, email. searches all fields when unspecified.

Responses
count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

slug
string

printable_name
string

Name that can be safely used for display in HTML pages

picture
string

URL location of the profile picture

extra
string

Extra meta data (can be stringify JSON)

rank
string

rank in filter

sample
string

reporting_status
string

current reporting status

last_activity_at
string

Most recent time an assessment was updated

last_reminder_at
string

Most recent time a reminder was sent

requested_at
string

Datetime at which the scorecard was requested

normalized_score
integer

score_url
string

link to the scorecard

api_remove
string

 

Examples
curl http://localhost:8040/api/energy-utility/reporting/sustainability/engagement
responds
{
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
    {
      "grantee": "energy-utility",
      "account": "supplier-1",
      "campaign": "sustainability",
      "created_at": "2022-01-01T00:00:00Z",
      "ends_at": "2023-01-01T00:00:00Z",
      "state": "request-denied",
      "api_accept": null,
      "reporting_status": "completed",
      "last_activity_at": "2022-11-01T00:00:00Z",
      "requested_at": "2022-01-01T00:00:00Z"
    },
    {
      "grantee": "energy-utility",
      "account": "andy-shop",
      "campaign": "sustainability",
      "created_at": "2022-01-01T00:00:00Z",
      "ends_at": "2023-01-01T00:00:00Z",
      "state": "request-accepted",
      "api_accept": null,
      "reporting_status": "completed",
      "last_activity_at": "2022-11-01T00:00:00Z",
      "requested_at": "2022-01-01T00:00:00Z"
    }
  ]
}

Retrieves engagement statistics

endpoint
GET /api/{profile}/reporting/{campaign}/engagement/stats

Returns the engagement as of Today

Responses
scale
number

The scale of the number reported in the tables (ex: 1000 when numbers are reported in thousands)

unit
string

Unit the measured field is in

title
string

Title for the table

results
array

Data series

slug
string

Unique key in the table for the data series

title
string

Title of data serie that can be safely used for display in HTML pages

extra
string

Extra meta data (can be stringify JSON)

values
array

Datapoints in the serie

 

Examples
curl http://localhost:8040/api/energy-utility/reporting/sustainability/engagement/stats
responds
{
  "title": "Completion rate (%)",
  "scale": 1,
  "unit": "percentage",
  "results": [
    {
      "slug": "completion-rate",
      "printable_name": "% completion",
      "values": [
        [
          "2020-09-13T00:00:00Z",
          0
        ],
        [
          "2020-09-20T00:00:00Z",
          0
        ],
        [
          "2020-09-27T00:00:00Z",
          0
        ],
        [
          "2020-10-04T00:00:00Z",
          0
        ],
        [
          "2020-10-11T00:00:00Z",
          0
        ],
        [
          "2020-10-18T00:00:00Z",
          0
        ],
        [
          "2020-10-25T00:00:00Z",
          0
        ],
        [
          "2020-11-01T00:00:00Z",
          0
        ],
        [
          "2020-11-08T00:00:00Z",
          0
        ],
        [
          "2020-11-15T00:00:00Z",
          0
        ],
        [
          "2020-11-22T00:00:00Z",
          0
        ],
        [
          "2020-11-29T00:00:00Z",
          0
        ],
        [
          "2020-12-06T00:00:00Z",
          0
        ],
        [
          "2020-12-13T00:00:00Z",
          0
        ],
        [
          "2020-12-20T00:00:00Z",
          0
        ],
        [
          "2020-12-27T00:00:00Z",
          0
        ],
        [
          "2021-01-03T00:00:00Z",
          0
        ]
      ]
    },
    {
      "slug": "last-year",
      "printable_name": "vs. last year",
      "values": [
        [
          "2019-09-15T00:00:00Z",
          0
        ],
        [
          "2019-09-22T00:00:00Z",
          0
        ],
        [
          "2019-09-29T00:00:00Z",
          0
        ],
        [
          "2019-10-06T00:00:00Z",
          0
        ],
        [
          "2019-10-13T00:00:00Z",
          0
        ],
        [
          "2019-10-20T00:00:00Z",
          0
        ],
        [
          "2019-10-27T00:00:00Z",
          0
        ],
        [
          "2019-11-03T00:00:00Z",
          0
        ],
        [
          "2019-11-10T00:00:00Z",
          0
        ],
        [
          "2019-11-17T00:00:00Z",
          0
        ],
        [
          "2019-11-24T00:00:00Z",
          0
        ],
        [
          "2019-12-01T00:00:00Z",
          0
        ],
        [
          "2019-12-08T00:00:00Z",
          0
        ],
        [
          "2019-12-15T00:00:00Z",
          0
        ],
        [
          "2019-12-22T00:00:00Z",
          0
        ],
        [
          "2019-12-29T00:00:00Z",
          0
        ],
        [
          "2020-01-05T00:00:00Z",
          0
        ]
      ]
    },
    {
      "slug": "alliance",
      "printable_name": "Alliance",
      "values": [
        [
          "2020-09-13T00:00:00Z",
          0
        ],
        [
          "2020-09-20T00:00:00Z",
          0
        ],
        [
          "2020-09-27T00:00:00Z",
          0
        ],
        [
          "2020-10-04T00:00:00Z",
          0
        ],
        [
          "2020-10-11T00:00:00Z",
          0
        ],
        [
          "2020-10-18T00:00:00Z",
          0
        ],
        [
          "2020-10-25T00:00:00Z",
          0
        ],
        [
          "2020-11-01T00:00:00Z",
          0
        ],
        [
          "2020-11-08T00:00:00Z",
          0
        ],
        [
          "2020-11-15T00:00:00Z",
          0
        ],
        [
          "2020-11-22T00:00:00Z",
          0
        ],
        [
          "2020-11-29T00:00:00Z",
          0
        ],
        [
          "2020-12-06T00:00:00Z",
          0
        ],
        [
          "2020-12-13T00:00:00Z",
          0
        ],
        [
          "2020-12-20T00:00:00Z",
          0
        ],
        [
          "2020-12-27T00:00:00Z",
          0
        ],
        [
          "2021-01-03T00:00:00Z",
          0
        ]
      ]
    }
  ]
}

Retrieves a matrix of scores for cohorts against a metric

endpoint
GET /api/{profile}/reporting/{campaign}/matrix/{path}

Uses the total score for each organization as recorded by the assessment surveys and present aggregates by industry sub-sectors (Boxes & enclosures, etc.)

Responses
slug
string

title
string

metric
object

slug
string

title
string

Title for the filter

extra
string

Extra meta data (can be stringify JSON)

predicates
array

rank
integer

operator
string

operand
string

field
string

selector
string

likely_metric
string

results
array

slug
string

printable_name
string

Name that can be safely used for display in HTML pages

picture
string

URL location of the profile picture

extra
string

Extra meta data (can be stringify JSON)

rank
string

rank in filter

cohorts
array

slug
string

title
string

Title for the filter

extra
string

Extra meta data (can be stringify JSON)

predicates
array

rank
integer

operator
string

operand
string

field
string

selector
string

likely_metric
string

results
array

slug
string

printable_name
string

Name that can be safely used for display in HTML pages

picture
string

URL location of the profile picture

extra
string

Extra meta data (can be stringify JSON)

rank
string

rank in filter

cut
object

slug
string

title
string

Title for the filter

extra
string

Extra meta data (can be stringify JSON)

predicates
array

rank
integer

operator
string

operand
string

field
string

selector
string

likely_metric
string

results
array

slug
string

printable_name
string

Name that can be safely used for display in HTML pages

picture
string

URL location of the profile picture

extra
string

Extra meta data (can be stringify JSON)

rank
string

rank in filter

 

Examples
curl http://localhost:8040/api/energy-utility/reporting/sustainability/matrix/totals
responds
{
  "slug": "totals",
  "title": "Average scores by supplier industry sub-sector",
  "cohorts": [
    {
      "slug": "/portfolio-a",
      "title": "Portfolio A",
      "tags": null,
      "predicates": [],
      "likely_metric": "/app/energy-utility/portfolios/portfolio-a/"
    }
  ]
}

Updates a matrix of scores for cohorts against a metric

endpoint
PUT /api/{profile}/reporting/{campaign}/matrix/{path}
Request body
slug
string

title
string required

metric
object required

slug
string

title
string required

Title for the filter

extra
string

Extra meta data (can be stringify JSON)

predicates
array

rank
integer

operator
string required

operand
string required

field
string required

selector
string required

results
array

cohorts
array required

slug
string

title
string required

Title for the filter

extra
string

Extra meta data (can be stringify JSON)

predicates
array

rank
integer

operator
string required

operand
string required

field
string required

selector
string required

results
array

cut
object required

slug
string

title
string required

Title for the filter

extra
string

Extra meta data (can be stringify JSON)

predicates
array

rank
integer

operator
string required

operand
string required

field
string required

selector
string required

results
array

Responses
slug
string

title
string

metric
object

slug
string

title
string

Title for the filter

extra
string

Extra meta data (can be stringify JSON)

predicates
array

rank
integer

operator
string

operand
string

field
string

selector
string

likely_metric
string

results
array

slug
string

printable_name
string

Name that can be safely used for display in HTML pages

picture
string

URL location of the profile picture

extra
string

Extra meta data (can be stringify JSON)

rank
string

rank in filter

cohorts
array

slug
string

title
string

Title for the filter

extra
string

Extra meta data (can be stringify JSON)

predicates
array

rank
integer

operator
string

operand
string

field
string

selector
string

likely_metric
string

results
array

slug
string

printable_name
string

Name that can be safely used for display in HTML pages

picture
string

URL location of the profile picture

extra
string

Extra meta data (can be stringify JSON)

rank
string

rank in filter

cut
object

slug
string

title
string

Title for the filter

extra
string

Extra meta data (can be stringify JSON)

predicates
array

rank
integer

operator
string

operand
string

field
string

selector
string

likely_metric
string

results
array

slug
string

printable_name
string

Name that can be safely used for display in HTML pages

picture
string

URL location of the profile picture

extra
string

Extra meta data (can be stringify JSON)

rank
string

rank in filter

 

Examples
curl -X PUT -H 'Content-Type: application/json; charset=UTF-8' -d '{"title": "Average scores by supplier industry sub-sector", "cohorts": []}' http://localhost:8040/api/energy-utility/reporting/sustainability/matrix/languages
responds
{
  "slug": "languages",
  "title": "All cohorts for all questions",
  "cohorts": []
}

Deletes a matrix of scores for cohorts against a metric

endpoint
DELETE /api/{profile}/reporting/{campaign}/matrix/{path}
Responses

204 No Content

 

Examples
curl -X DELETE http://localhost:8040/api/energy-utility/reporting/sustainability/matrix/languages

Lists samples

endpoint
GET /api/{profile}/sample

Returns all samples for a profile

Query parameters
page
integer

A page number within the paginated result set.

start_at
string

date/time in ISO format

ends_at
string

date/time in ISO format

state
string

filter by state (active, completed)

o
string

sort by created_at, campaign__title, is_frozen. If a field is preceded by a minus sign ('-'), the order will be reversed. Multiple 'o' parameters can be specified to produce a stable result.

Responses
count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

campaign
object

Campaign this sample is part of

slug
string

Unique identifier that can be used in a URL

account
string

Account this sample belongs to.

title
string

Title of the campaign as displayed in user interfaces

description
string

Long form description displayed to users responding to the campaign

created_at
string

active
boolean

Whether the campaign is available or not

slug
string

Unique identifier for the sample. It can be used in a URL.

account
string

Account this sample belongs to

created_at
string

Date/time of creation (in ISO format)

updated_at
string

Date/time of last update (in ISO format)

is_frozen
boolean

When True, answers to that sample cannot be updated.

location
string

URL at which the response is visible

grantees
array

Profiles with which sample was shared

 

Examples
curl http://localhost:8040/api/supplier-1/sample
responds
{
  "count": 1,
  "previous": null,
  "next": null,
  "results": [
    {
      "slug": "46f66f70f5ad41b29c4df08f683a9a7a",
      "created_at": "2018-01-24T17:03:34.926193Z",
      "campaign": "sustainability",
      "is_frozen": false,
      "extra": null
    }
  ]
}

Creates a sample

endpoint
POST /api/{profile}/sample

Creates a new sample to record qualitative and/or quantitative data.

Request body
campaign
string

Campaign this sample is part of.

Responses
campaign
object

Campaign this sample is part of

slug
string

Unique identifier that can be used in a URL

account
string

Account this sample belongs to.

title
string

Title of the campaign as displayed in user interfaces

description
string

Long form description displayed to users responding to the campaign

created_at
string

active
boolean

Whether the campaign is available or not

slug
string

Unique identifier for the sample. It can be used in a URL.

account
string

Account this sample belongs to

created_at
string

Date/time of creation (in ISO format)

updated_at
string

Date/time of last update (in ISO format)

is_frozen
boolean

When True, answers to that sample cannot be updated.

location
string

URL at which the response is visible

grantees
array

Profiles with which sample was shared

 

Examples
curl -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{}' http://localhost:8040/api/supplier-1/sample
responds
{
  "slug": "46f66f70f5ad41b29c4df08f683a9a7a",
  "created_at": "2018-01-24T17:03:34.926193Z",
  "campaign": "sustainability"
}

Retrieves a sample

endpoint
GET /api/{profile}/sample/{sample}

Returns top level information about a sample.

Responses
campaign
object

Campaign this sample is part of

slug
string

Unique identifier that can be used in a URL

account
string

Account this sample belongs to.

title
string

Title of the campaign as displayed in user interfaces

description
string

Long form description displayed to users responding to the campaign

created_at
string

active
boolean

Whether the campaign is available or not

slug
string

Unique identifier for the sample. It can be used in a URL.

account
string

Account this sample belongs to

created_at
string

Date/time of creation (in ISO format)

updated_at
string

Date/time of last update (in ISO format)

is_frozen
boolean

When True, answers to that sample cannot be updated.

location
string

URL at which the response is visible

grantees
array

Profiles with which sample was shared

 

Examples
curl http://localhost:8040/api/supplier-1/sample/46f66f70f5ad41b29c4df08f683a9a7a
responds
{
  "slug": "46f66f70f5ad41b29c4df08f683a9a7a",
  "created_at": "2018-01-24T17:03:34.926193Z",
  "updated_at": "2018-01-24T17:03:34.926193Z",
  "is_frozen": false,
  "account": "supplier-1",
  "campaign": {
    "slug": "sustainability",
    "title": "ESG/Environmental practices"
  }
}

Lists answers

endpoint
GET /api/{profile}/sample/{sample}/answers

The list returned contains at least one measurement for each question in the campaign. If there are no measurement yet on a question, measured will be null.

There might be more than one measurement per question as long as there are no duplicated unit per question. For example, to the question adjust-air-fuel-ratio, there could be a measurement with unit assessment (Mostly Yes/ Yes / No / Mostly No) and a measurement with unit freetext (i.e. a comment).

The {sample} must belong to {organization}.

{path} can be used to filter the tree of questions by a prefix.

Query parameters
page
integer

A page number within the paginated result set.

Responses
count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

unit
string

Unit the measured field is in

measured
string

measurement in unit

created_at
string

Date/time of creation (in ISO format)

collected_by
string

User that collected the answer

question
object

Question the answer refers to

path
string

Unique identifier that can be used in URL

title
string

Short description

default_unit
object

slug
string

Unique identifier that can be used in a URL

title
string

Short description suitable for display

system
string

One of standard (metric system), imperial, rank, enum, or freetext

choices
array

text
string

short name for the enumerated value (as used in source code)

descr
string

long form description of the enumerated value (for help tooltips)

ui_hint
string

Hint for the user interface on how to present the input field

required
boolean

Whether an answer is required or not.

 

Examples
curl http://localhost:8040/api/supplier-1/sample/46f66f70f5ad41b29c4df08f683a9a7a/answers
responds
{
  "count": 3,
  "previous": null,
  "next": null,
  "results": [
    {
      "question": {
        "path": "/construction/governance/the-assessment-process-is-rigorous",
        "title": "The assessment process is rigorous",
        "default_unit": {
          "slug": "assessment",
          "title": "assessments",
          "system": "enum",
          "choices": [
            {
              "rank": 1,
              "text": "mostly-yes",
              "descr": "Mostly yes"
            },
            {
              "rank": 2,
              "text": "yes",
              "descr": "Yes"
            },
            {
              "rank": 3,
              "text": "no",
              "descr": "No"
            },
            {
              "rank": 4,
              "text": "mostly-no",
              "descr": "Mostly no"
            }
          ]
        },
        "ui_hint": "radio"
      },
      "required": true,
      "measured": "yes",
      "unit": "assessment",
      "created_at": "2020-09-28T00:00:00.000000Z",
      "collected_by": "steve"
    },
    {
      "question": {
        "path": "/construction/governance/the-assessment-process-is-rigorous",
        "title": "The assessment process is rigorous",
        "default_unit": {
          "slug": "assessment",
          "title": "assessments",
          "system": "enum",
          "choices": [
            {
              "rank": 1,
              "text": "mostly-yes",
              "descr": "Mostly yes"
            },
            {
              "rank": 2,
              "text": "yes",
              "descr": "Yes"
            },
            {
              "rank": 3,
              "text": "no",
              "descr": "No"
            },
            {
              "rank": 4,
              "text": "mostly-no",
              "descr": "Mostly no"
            }
          ]
        },
        "ui_hint": "radio"
      },
      "measured": "Policy document on the public website",
      "unit": "freetext",
      "created_at": "2020-09-28T00:00:00.000000Z",
      "collected_by": "steve"
    },
    {
      "question": {
        "path": "/construction/production/adjust-air-fuel-ratio",
        "title": "Adjust Air fuel ratio",
        "default_unit": {
          "slug": "assessment",
          "title": "assessments",
          "system": "enum",
          "choices": [
            {
              "rank": 1,
              "text": "mostly-yes",
              "descr": "Mostly yes"
            },
            {
              "rank": 2,
              "text": "yes",
              "descr": "Yes"
            },
            {
              "rank": 3,
              "text": "no",
              "descr": "No"
            },
            {
              "rank": 4,
              "text": "mostly-no",
              "descr": "Mostly no"
            }
          ]
        },
        "ui_hint": "radio"
      },
      "required": true,
      "measured": null,
      "unit": null
    }
  ]
}

Lists answers matching prefix

endpoint
GET /api/{profile}/sample/{sample}/answers/{path}

The list returned contains at least one measurement for each question in the campaign. If there are no measurement yet on a question, measured will be null.

There might be more than one measurement per question as long as there are no duplicated unit per question. For example, to the question adjust-air-fuel-ratio, there could be a measurement with unit assessment (Mostly Yes/ Yes / No / Mostly No) and a measurement with unit freetext (i.e. a comment).

The {sample} must belong to {organization}.

{path} can be used to filter the tree of questions by a prefix.

Responses
count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

unit
string

Unit the measured field is in

measured
string

measurement in unit

created_at
string

Date/time of creation (in ISO format)

collected_by
string

User that collected the answer

question
object

Question the answer refers to

path
string

Unique identifier that can be used in URL

title
string

Short description

default_unit
object

slug
string

Unique identifier that can be used in a URL

title
string

Short description suitable for display

system
string

One of standard (metric system), imperial, rank, enum, or freetext

choices
array

text
string

short name for the enumerated value (as used in source code)

descr
string

long form description of the enumerated value (for help tooltips)

ui_hint
string

Hint for the user interface on how to present the input field

required
boolean

Whether an answer is required or not.

 

Examples
curl http://localhost:8040/api/supplier-1/sample/46f66f70f5ad41b29c4df08f683a9a7a/answers/construction
responds
{
  "count": 3,
  "previous": null,
  "next": null,
  "results": [
    {
      "question": {
        "path": "/construction/governance/the-assessment-process-is-rigorous",
        "title": "The assessment process is rigorous",
        "default_unit": {
          "slug": "assessment",
          "title": "assessments",
          "system": "enum",
          "choices": [
            {
              "rank": 1,
              "text": "mostly-yes",
              "descr": "Mostly yes"
            },
            {
              "rank": 2,
              "text": "yes",
              "descr": "Yes"
            },
            {
              "rank": 3,
              "text": "no",
              "descr": "No"
            },
            {
              "rank": 4,
              "text": "mostly-no",
              "descr": "Mostly no"
            }
          ]
        },
        "ui_hint": "radio"
      },
      "required": true,
      "measured": "yes",
      "unit": "assessment",
      "created_at": "2020-09-28T00:00:00.000000Z",
      "collected_by": "steve"
    },
    {
      "question": {
        "path": "/construction/governance/the-assessment-process-is-rigorous",
        "title": "The assessment process is rigorous",
        "default_unit": {
          "slug": "assessment",
          "title": "assessments",
          "system": "enum",
          "choices": [
            {
              "rank": 1,
              "text": "mostly-yes",
              "descr": "Mostly yes"
            },
            {
              "rank": 2,
              "text": "yes",
              "descr": "Yes"
            },
            {
              "rank": 3,
              "text": "no",
              "descr": "No"
            },
            {
              "rank": 4,
              "text": "mostly-no",
              "descr": "Mostly no"
            }
          ]
        },
        "ui_hint": "radio"
      },
      "measured": "Policy document on the public website",
      "unit": "freetext",
      "created_at": "2020-09-28T00:00:00.000000Z",
      "collected_by": "steve"
    },
    {
      "question": {
        "path": "/construction/production/adjust-air-fuel-ratio",
        "title": "Adjust Air fuel ratio",
        "default_unit": {
          "slug": "assessment",
          "title": "assessments",
          "system": "enum",
          "choices": [
            {
              "rank": 1,
              "text": "mostly-yes",
              "descr": "Mostly yes"
            },
            {
              "rank": 2,
              "text": "yes",
              "descr": "Yes"
            },
            {
              "rank": 3,
              "text": "no",
              "descr": "No"
            },
            {
              "rank": 4,
              "text": "mostly-no",
              "descr": "Mostly no"
            }
          ]
        },
        "ui_hint": "radio"
      },
      "required": true,
      "measured": null,
      "unit": null
    }
  ]
}

Updates an answer

endpoint
POST /api/{profile}/sample/{sample}/answers/{path}

This API end-point attaches a measurement (measured field) in unit (meters, kilograms, etc.) to a question (also called metric) named {path} as part of a {sample}.

If a measurement with that unit already exists for the couple ({path}, {sample}), the previous measurement is replaced, otherwise it is added.

If unit is not specified, the default unit for the question is used.

The {sample} must belong to {organization} and be updatable.

Request body
unit
string

Unit the measured field is in

measured
string required

measurement in unit

Responses
unit
string

Unit the measured field is in

measured
string

measurement in unit

created_at
string

Date/time of creation (in ISO format)

collected_by
string

User that collected the answer

 

Examples
curl -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{"measured": "mostly-no", "unit": "assessment"}' http://localhost:8040/api/supplier-1/sample/724bf9648af6420ba79c8a37f962e97e/answers/construction
responds
{
  "created_at": "2020-09-28T00:00:00.000000Z",
  "collected_by": "steve",
  "measured": "mostly-no",
  "unit": "assessment"
}

Retrieves benchmarks

endpoint
GET /api/{profile}/sample/{sample}/benchmarks

Returns a list of graphs with anonymized performance of peers for paths marked as visible (see ::ref::api_score).

Responses
count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

slug
string

Unique identifier that can be used in URL paths

path
string

path from the root of content tree

indent
string

level in the content tree

account
string

Account that can edit the page element

title
string

Title of the page element

picture
string

Picture icon that can be displayed alongside the title

extra
string

Extra meta data (can be stringify JSON)

default_unit
string

score_weight
string

rank
string

required
string

frozen
string

url
string

segments
array

avg_normalized_score
integer

highest_normalized_score
integer

nb_respondents
integer

organization_rate
string

benchmarks
array

slug
string

Unique key in the table for the data series

title
string

Title of data serie that can be safely used for display in HTML pages

extra
string

Extra meta data (can be stringify JSON)

values
array

Datapoints in the serie

 

Examples
curl http://localhost:8040/api/supplier-1/sample/ce6dc2c4cf6b40dbacef91fa3e934eed/benchmarks
responds
{
  "avg_normalized_score": 50,
  "highest_normalized_score": 100,
  "results": [
    {
      "slug": "totals",
      "title": "Total Score",
      "nb_answers": 4,
      "nb_questions": 4,
      "nb_respondents": 2,
      "numerator": 12.0,
      "improvement_numerator": 8.0,
      "denominator": 26.0,
      "normalized_score": 46,
      "improvement_score": 30,
      "score_weight": 1.0,
      "highest_normalized_score": 88,
      "avg_normalized_score": 67,
      "created_at": "2017-08-02T20:18:19.089",
      "distribution": {
        "y": [
          0,
          1,
          0,
          1
        ],
        "x": [
          "0-25%",
          "25-50%",
          "50-75%",
          "75-100%"
        ],
        "organization_rate": "25-50%"
      }
    },
    {
      "slug": "energy-efficiency-management-basics",
      "title": "Management",
      "text": "/media/envconnect/management-basics.png",
      "tag": "management",
      "score_weight": 1.0
    },
    {
      "slug": "process-heating",
      "title": "Process heating",
      "text": "/media/envconnect/process-heating.png",
      "nb_questions": 4,
      "nb_answers": 4,
      "nb_respondents": 2,
      "numerator": 12.0,
      "improvement_numerator": 8.0,
      "denominator": 26.0,
      "normalized_score": 46,
      "improvement_score": 12,
      "highest_normalized_score": 88,
      "avg_normalized_score": 67,
      "created_at": "2017-08-02T20:18:19.089",
      "distribution": {
        "y": [
          0,
          1,
          0,
          1
        ],
        "x": [
          "0-25%",
          "25-50%",
          "50-75%",
          "75-100%"
        ],
        "organization_rate": "25-50%"
      },
      "score_weight": 1.0
    }
  ]
}

Retrieves benchmarks matching prefix

endpoint
GET /api/{profile}/sample/{sample}/benchmarks/{path}

XXX change resp to a {count:, results:} format.

Returns a list of graphs with anonymized performance of peers for paths marked as visible (see ::ref::api_score).

Responses
count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

slug
string

Unique identifier that can be used in URL paths

path
string

path from the root of content tree

indent
string

level in the content tree

account
string

Account that can edit the page element

title
string

Title of the page element

picture
string

Picture icon that can be displayed alongside the title

extra
string

Extra meta data (can be stringify JSON)

default_unit
string

score_weight
string

rank
string

required
string

frozen
string

url
string

segments
array

avg_normalized_score
integer

highest_normalized_score
integer

nb_respondents
integer

organization_rate
string

benchmarks
array

slug
string

Unique key in the table for the data series

title
string

Title of data serie that can be safely used for display in HTML pages

extra
string

Extra meta data (can be stringify JSON)

values
array

Datapoints in the serie

 

Examples
curl http://localhost:8040/api/supplier-1/sample/ce6dc2c4cf6b40dbacef91fa3e934eed/benchmarks/boxes-enclosures
responds
{
  "avg_normalized_score": 50,
  "highest_normalized_score": 100,
  "results": [
    {
      "slug": "totals",
      "title": "Total Score",
      "nb_answers": 4,
      "nb_questions": 4,
      "nb_respondents": 2,
      "numerator": 12.0,
      "improvement_numerator": 8.0,
      "denominator": 26.0,
      "normalized_score": 46,
      "improvement_score": 30,
      "score_weight": 1.0,
      "highest_normalized_score": 88,
      "avg_normalized_score": 67,
      "created_at": "2017-08-02T20:18:19.089",
      "distribution": {
        "y": [
          0,
          1,
          0,
          1
        ],
        "x": [
          "0-25%",
          "25-50%",
          "50-75%",
          "75-100%"
        ],
        "organization_rate": "25-50%"
      }
    },
    {
      "slug": "energy-efficiency-management-basics",
      "title": "Management",
      "text": "/media/envconnect/management-basics.png",
      "tag": "management",
      "score_weight": 1.0
    },
    {
      "slug": "process-heating",
      "title": "Process heating",
      "text": "/media/envconnect/process-heating.png",
      "nb_questions": 4,
      "nb_answers": 4,
      "nb_respondents": 2,
      "numerator": 12.0,
      "improvement_numerator": 8.0,
      "denominator": 26.0,
      "normalized_score": 46,
      "improvement_score": 12,
      "highest_normalized_score": 88,
      "avg_normalized_score": 67,
      "created_at": "2017-08-02T20:18:19.089",
      "distribution": {
        "y": [
          0,
          1,
          0,
          1
        ],
        "x": [
          "0-25%",
          "25-50%",
          "50-75%",
          "75-100%"
        ],
        "organization_rate": "25-50%"
      },
      "score_weight": 1.0
    }
  ]
}

Lists candidate answers

endpoint
GET /api/{profile}/sample/{sample}/candidates

The list returned contains at least one answer for each question in the campaign. If there are no answer yet on a question, measured will be null.

There might be more than one answer per question as long as there are no duplicated unit per question. For example, to the question adjust-air-fuel-ratio, there could be an answer with unit assessment (Mostly Yes/ Yes / No / Mostly No) and an answer with unit freetext (i.e. a comment).

The sample must belong to organization.

path can be used to filter the tree of questions by a prefix.

Query parameters
page
integer

A page number within the paginated result set.

Responses
count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

unit
string

Unit the measured field is in

measured
string

measurement in unit

created_at
string

Date/time of creation (in ISO format)

collected_by
string

User that collected the answer

question
object

Question the answer refers to

path
string

Unique identifier that can be used in URL

title
string

Short description

default_unit
object

slug
string

Unique identifier that can be used in a URL

title
string

Short description suitable for display

system
string

One of standard (metric system), imperial, rank, enum, or freetext

choices
array

text
string

short name for the enumerated value (as used in source code)

descr
string

long form description of the enumerated value (for help tooltips)

ui_hint
string

Hint for the user interface on how to present the input field

required
boolean

Whether an answer is required or not.

 

Examples
curl http://localhost:8040/api/supplier-1/sample/46f66f70f5ad41b29c4df08f683a9a7a/candidates
responds
{
  "count": 3,
  "previous": null,
  "next": null,
  "results": [
    {
      "question": {
        "path": "/construction/governance/the-assessment-process-is-rigorous",
        "title": "The assessment process is rigorous",
        "default_unit": {
          "slug": "assessment",
          "title": "assessments",
          "system": "enum",
          "choices": [
            {
              "rank": 1,
              "text": "mostly-yes",
              "descr": "Mostly yes"
            },
            {
              "rank": 2,
              "text": "yes",
              "descr": "Yes"
            },
            {
              "rank": 3,
              "text": "no",
              "descr": "No"
            },
            {
              "rank": 4,
              "text": "mostly-no",
              "descr": "Mostly no"
            }
          ]
        },
        "ui_hint": "radio"
      },
      "required": true,
      "measured": "yes",
      "unit": "assessment",
      "created_at": "2020-09-28T00:00:00.000000Z",
      "collected_by": "steve"
    },
    {
      "question": {
        "path": "/construction/governance/the-assessment-process-is-rigorous",
        "title": "The assessment process is rigorous",
        "default_unit": {
          "slug": "assessment",
          "title": "assessments",
          "system": "enum",
          "choices": [
            {
              "rank": 1,
              "text": "mostly-yes",
              "descr": "Mostly yes"
            },
            {
              "rank": 2,
              "text": "yes",
              "descr": "Yes"
            },
            {
              "rank": 3,
              "text": "no",
              "descr": "No"
            },
            {
              "rank": 4,
              "text": "mostly-no",
              "descr": "Mostly no"
            }
          ]
        },
        "ui_hint": "radio"
      },
      "measured": "Policy document on the public website",
      "unit": "freetext",
      "created_at": "2020-09-28T00:00:00.000000Z",
      "collected_by": "steve"
    },
    {
      "question": {
        "path": "/construction/production/adjust-air-fuel-ratio",
        "title": "Adjust Air fuel ratio",
        "default_unit": {
          "slug": "assessment",
          "title": "assessments",
          "system": "enum",
          "choices": [
            {
              "rank": 1,
              "text": "mostly-yes",
              "descr": "Mostly yes"
            },
            {
              "rank": 2,
              "text": "yes",
              "descr": "Yes"
            },
            {
              "rank": 3,
              "text": "no",
              "descr": "No"
            },
            {
              "rank": 4,
              "text": "mostly-no",
              "descr": "Mostly no"
            }
          ]
        },
        "ui_hint": "radio"
      },
      "required": true,
      "measured": null,
      "unit": null
    }
  ]
}

Uses candidate answers matching prefix

endpoint
POST /api/{profile}/sample/{sample}/candidates

The list returned contains at least one answer for each question in the campaign. If there are no answer yet on a question, measured will be null.

There might be more than one answer per question as long as there are no duplicated unit per question. For example, to the question adjust-air-fuel-ratio, there could be an answer with unit assessment (Mostly Yes/ Yes / No / Mostly No) and an answer with unit freetext (i.e. a comment).

The sample must belong to organization.

path can be used to filter the tree of questions by a prefix.

Responses
count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

unit
string

Unit the measured field is in

measured
string

measurement in unit

created_at
string

Date/time of creation (in ISO format)

collected_by
string

User that collected the answer

question
object

Question the answer refers to

path
string

Unique identifier that can be used in URL

title
string

Short description

default_unit
object

slug
string

Unique identifier that can be used in a URL

title
string

Short description suitable for display

system
string

One of standard (metric system), imperial, rank, enum, or freetext

choices
array

text
string

short name for the enumerated value (as used in source code)

descr
string

long form description of the enumerated value (for help tooltips)

ui_hint
string

Hint for the user interface on how to present the input field

required
boolean

Whether an answer is required or not.

 

Examples
curl -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{}' http://localhost:8040/api/supplier-1/sample/46f66f70f5ad41b29c4df08f683a9a7a/candidates
responds
{
  "count": 3,
  "previous": null,
  "next": null,
  "results": [
    {
      "question": {
        "path": "/construction/governance/the-assessment-process-is-rigorous",
        "title": "The assessment process is rigorous",
        "default_unit": {
          "slug": "assessment",
          "title": "assessments",
          "system": "enum",
          "choices": [
            {
              "rank": 1,
              "text": "mostly-yes",
              "descr": "Mostly yes"
            },
            {
              "rank": 2,
              "text": "yes",
              "descr": "Yes"
            },
            {
              "rank": 3,
              "text": "no",
              "descr": "No"
            },
            {
              "rank": 4,
              "text": "mostly-no",
              "descr": "Mostly no"
            }
          ]
        },
        "ui_hint": "radio"
      },
      "required": true,
      "measured": "yes",
      "unit": "assessment",
      "created_at": "2020-09-28T00:00:00.000000Z",
      "collected_by": "steve"
    },
    {
      "question": {
        "path": "/construction/governance/the-assessment-process-is-rigorous",
        "title": "The assessment process is rigorous",
        "default_unit": {
          "slug": "assessment",
          "title": "assessments",
          "system": "enum",
          "choices": [
            {
              "rank": 1,
              "text": "mostly-yes",
              "descr": "Mostly yes"
            },
            {
              "rank": 2,
              "text": "yes",
              "descr": "Yes"
            },
            {
              "rank": 3,
              "text": "no",
              "descr": "No"
            },
            {
              "rank": 4,
              "text": "mostly-no",
              "descr": "Mostly no"
            }
          ]
        },
        "ui_hint": "radio"
      },
      "measured": "Policy document on the public website",
      "unit": "freetext",
      "created_at": "2020-09-28T00:00:00.000000Z",
      "collected_by": "steve"
    },
    {
      "question": {
        "path": "/construction/production/adjust-air-fuel-ratio",
        "title": "Adjust Air fuel ratio",
        "default_unit": {
          "slug": "assessment",
          "title": "assessments",
          "system": "enum",
          "choices": [
            {
              "rank": 1,
              "text": "mostly-yes",
              "descr": "Mostly yes"
            },
            {
              "rank": 2,
              "text": "yes",
              "descr": "Yes"
            },
            {
              "rank": 3,
              "text": "no",
              "descr": "No"
            },
            {
              "rank": 4,
              "text": "mostly-no",
              "descr": "Mostly no"
            }
          ]
        },
        "ui_hint": "radio"
      },
      "required": true,
      "measured": null,
      "unit": null
    }
  ]
}

Lists candidate answers matching prefix

endpoint
GET /api/{profile}/sample/{sample}/candidates/{path}

The list returned contains at least one answer for each question in the campaign. If there are no answer yet on a question, measured will be null.

There might be more than one answer per question as long as there are no duplicated unit per question. For example, to the question adjust-air-fuel-ratio, there could be an answer with unit assessment (Mostly Yes/ Yes / No / Mostly No) and an answer with unit freetext (i.e. a comment).

The sample must belong to organization.

path can be used to filter the tree of questions by a prefix.

Responses
count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

unit
string

Unit the measured field is in

measured
string

measurement in unit

created_at
string

Date/time of creation (in ISO format)

collected_by
string

User that collected the answer

question
object

Question the answer refers to

path
string

Unique identifier that can be used in URL

title
string

Short description

default_unit
object

slug
string

Unique identifier that can be used in a URL

title
string

Short description suitable for display

system
string

One of standard (metric system), imperial, rank, enum, or freetext

choices
array

text
string

short name for the enumerated value (as used in source code)

descr
string

long form description of the enumerated value (for help tooltips)

ui_hint
string

Hint for the user interface on how to present the input field

required
boolean

Whether an answer is required or not.

 

Examples
curl http://localhost:8040/api/supplier-1/sample/46f66f70f5ad41b29c4df08f683a9a7a/candidates/construction
responds
{
  "count": 3,
  "previous": null,
  "next": null,
  "results": [
    {
      "question": {
        "path": "/construction/governance/the-assessment-process-is-rigorous",
        "title": "The assessment process is rigorous",
        "default_unit": {
          "slug": "assessment",
          "title": "assessments",
          "system": "enum",
          "choices": [
            {
              "rank": 1,
              "text": "mostly-yes",
              "descr": "Mostly yes"
            },
            {
              "rank": 2,
              "text": "yes",
              "descr": "Yes"
            },
            {
              "rank": 3,
              "text": "no",
              "descr": "No"
            },
            {
              "rank": 4,
              "text": "mostly-no",
              "descr": "Mostly no"
            }
          ]
        },
        "ui_hint": "radio"
      },
      "required": true,
      "measured": "yes",
      "unit": "assessment",
      "created_at": "2020-09-28T00:00:00.000000Z",
      "collected_by": "steve"
    },
    {
      "question": {
        "path": "/construction/governance/the-assessment-process-is-rigorous",
        "title": "The assessment process is rigorous",
        "default_unit": {
          "slug": "assessment",
          "title": "assessments",
          "system": "enum",
          "choices": [
            {
              "rank": 1,
              "text": "mostly-yes",
              "descr": "Mostly yes"
            },
            {
              "rank": 2,
              "text": "yes",
              "descr": "Yes"
            },
            {
              "rank": 3,
              "text": "no",
              "descr": "No"
            },
            {
              "rank": 4,
              "text": "mostly-no",
              "descr": "Mostly no"
            }
          ]
        },
        "ui_hint": "radio"
      },
      "measured": "Policy document on the public website",
      "unit": "freetext",
      "created_at": "2020-09-28T00:00:00.000000Z",
      "collected_by": "steve"
    },
    {
      "question": {
        "path": "/construction/production/adjust-air-fuel-ratio",
        "title": "Adjust Air fuel ratio",
        "default_unit": {
          "slug": "assessment",
          "title": "assessments",
          "system": "enum",
          "choices": [
            {
              "rank": 1,
              "text": "mostly-yes",
              "descr": "Mostly yes"
            },
            {
              "rank": 2,
              "text": "yes",
              "descr": "Yes"
            },
            {
              "rank": 3,
              "text": "no",
              "descr": "No"
            },
            {
              "rank": 4,
              "text": "mostly-no",
              "descr": "Mostly no"
            }
          ]
        },
        "ui_hint": "radio"
      },
      "required": true,
      "measured": null,
      "unit": null
    }
  ]
}

Uses candidate answers

endpoint
POST /api/{profile}/sample/{sample}/candidates/{path}

The list returned contains at least one answer for each question in the campaign. If there are no answer yet on a question, measured will be null.

There might be more than one answer per question as long as there are no duplicated unit per question. For example, to the question adjust-air-fuel-ratio, there could be an answer with unit assessment (Mostly Yes/ Yes / No / Mostly No) and an answer with unit freetext (i.e. a comment).

The sample must belong to organization.

path can be used to filter the tree of questions by a prefix.

Responses
count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

unit
string

Unit the measured field is in

measured
string

measurement in unit

created_at
string

Date/time of creation (in ISO format)

collected_by
string

User that collected the answer

question
object

Question the answer refers to

path
string

Unique identifier that can be used in URL

title
string

Short description

default_unit
object

slug
string

Unique identifier that can be used in a URL

title
string

Short description suitable for display

system
string

One of standard (metric system), imperial, rank, enum, or freetext

choices
array

text
string

short name for the enumerated value (as used in source code)

descr
string

long form description of the enumerated value (for help tooltips)

ui_hint
string

Hint for the user interface on how to present the input field

required
boolean

Whether an answer is required or not.

 

Examples
curl -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{}' http://localhost:8040/api/supplier-1/sample/46f66f70f5ad41b29c4df08f683a9a7a/candidates/construction
responds
{
  "count": 3,
  "previous": null,
  "next": null,
  "results": [
    {
      "question": {
        "path": "/construction/governance/the-assessment-process-is-rigorous",
        "title": "The assessment process is rigorous",
        "default_unit": {
          "slug": "assessment",
          "title": "assessments",
          "system": "enum",
          "choices": [
            {
              "rank": 1,
              "text": "mostly-yes",
              "descr": "Mostly yes"
            },
            {
              "rank": 2,
              "text": "yes",
              "descr": "Yes"
            },
            {
              "rank": 3,
              "text": "no",
              "descr": "No"
            },
            {
              "rank": 4,
              "text": "mostly-no",
              "descr": "Mostly no"
            }
          ]
        },
        "ui_hint": "radio"
      },
      "required": true,
      "measured": "yes",
      "unit": "assessment",
      "created_at": "2020-09-28T00:00:00.000000Z",
      "collected_by": "steve"
    },
    {
      "question": {
        "path": "/construction/governance/the-assessment-process-is-rigorous",
        "title": "The assessment process is rigorous",
        "default_unit": {
          "slug": "assessment",
          "title": "assessments",
          "system": "enum",
          "choices": [
            {
              "rank": 1,
              "text": "mostly-yes",
              "descr": "Mostly yes"
            },
            {
              "rank": 2,
              "text": "yes",
              "descr": "Yes"
            },
            {
              "rank": 3,
              "text": "no",
              "descr": "No"
            },
            {
              "rank": 4,
              "text": "mostly-no",
              "descr": "Mostly no"
            }
          ]
        },
        "ui_hint": "radio"
      },
      "measured": "Policy document on the public website",
      "unit": "freetext",
      "created_at": "2020-09-28T00:00:00.000000Z",
      "collected_by": "steve"
    },
    {
      "question": {
        "path": "/construction/production/adjust-air-fuel-ratio",
        "title": "Adjust Air fuel ratio",
        "default_unit": {
          "slug": "assessment",
          "title": "assessments",
          "system": "enum",
          "choices": [
            {
              "rank": 1,
              "text": "mostly-yes",
              "descr": "Mostly yes"
            },
            {
              "rank": 2,
              "text": "yes",
              "descr": "Yes"
            },
            {
              "rank": 3,
              "text": "no",
              "descr": "No"
            },
            {
              "rank": 4,
              "text": "mostly-no",
              "descr": "Mostly no"
            }
          ]
        },
        "ui_hint": "radio"
      },
      "required": true,
      "measured": null,
      "unit": null
    }
  ]
}

Formats answers

endpoint
GET /api/{profile}/sample/{sample}/content

The list returned contains at least one measurement for each question in the campaign. If there are no measurement yet on a question, measured will be null.

There might be more than one measurement per question as long as there are no duplicated unit per question. For example, to the question adjust-air-fuel-ratio, there could be a measurement with unit assessment (Mostly Yes/ Yes / No / Mostly No) and a measurement with unit freetext (i.e. a comment).

The {sample} must belong to {organization}.

{path} can be used to filter the tree of questions by a prefix.

Query parameters
page
integer

A page number within the paginated result set.

Responses
count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

slug
string

Unique identifier that can be used in URL paths

path
string

path from the root of content tree

indent
string

level in the content tree

account
string

Account that can edit the page element

title
string

Title of the page element

picture
string

Picture icon that can be displayed alongside the title

extra
string

Extra meta data (can be stringify JSON)

default_unit
string

score_weight
string

rank
string

required
string

frozen
string

url
string

segments
array

ui_hint
string

text
string

answers
array

unit
string

Unit the measured field is in

measured
string

measurement in unit

created_at
string

Date/time of creation (in ISO format)

collected_by
string

User that collected the answer

candidates
array

unit
string

Unit the measured field is in

measured
string

measurement in unit

created_at
string

Date/time of creation (in ISO format)

collected_by
string

User that collected the answer

planned
array

unit
string

Unit the measured field is in

measured
string

measurement in unit

created_at
string

Date/time of creation (in ISO format)

collected_by
string

User that collected the answer

notes
array

unit
string

Unit the measured field is in

measured
string

measurement in unit

created_at
string

Date/time of creation (in ISO format)

collected_by
string

User that collected the answer

normalized_score
string

nb_respondents
string

rate
string

opportunity
string

 

Examples
curl http://localhost:8040/api/andy-shop/sample/f1e2e916eb494b90f9ff0a36982342/content
responds
{
  "count": 4,
  "results": [
    {
      "count": 1,
      "slug": "sustainability",
      "path": "/sustainability",
      "indent": 0,
      "title": "Core Environment, Social and Governance (ESG) Assessment",
      "picture": null,
      "extra": {
        "pagebreak": true,
        "tags": [
          "scorecard"
        ],
        "visibility": [
          "public"
        ],
        "segments": [
          "/sustainability"
        ]
      },
      "rank": -1,
      "required": false,
      "default_unit": null,
      "ui_hint": null,
      "nb_respondents": 0,
      "rate": {},
      "opportunity": null
    },
    {
      "count": 1,
      "slug": "governance",
      "path": "/sustainability/governance",
      "indent": 1,
      "title": "Strategy & Governance",
      "picture": "/tspproject/static/img/management-basics.png",
      "extra": {
        "segments": [
          "/sustainability"
        ]
      },
      "rank": 1,
      "required": false,
      "default_unit": null,
      "ui_hint": null,
      "nb_respondents": 0,
      "rate": {},
      "opportunity": null
    },
    {
      "count": 1,
      "slug": "esg-strategy-heading",
      "path": "/sustainability/governance/esg-strategy-heading",
      "indent": 2,
      "title": "Environment, Social & Governance (ESG) Strategy",
      "picture": null,
      "extra": {
        "segments": [
          "/sustainability"
        ]
      },
      "rank": 1,
      "required": false,
      "default_unit": null,
      "ui_hint": null,
      "nb_respondents": 0,
      "rate": {},
      "opportunity": null
    },
    {
      "count": 1,
      "slug": "formalized-esg-strategy",
      "path": "/sustainability/governance/esg-strategy-heading/formalized-esg-strategy",
      "indent": 3,
      "title": "(3) Does your company have a formalized ESG strategy?",
      "picture": "/tspproject/static/img/management-basics.png",
      "extra": {
        "segments": [
          "/sustainability"
        ]
      },
      "rank": 4,
      "required": true,
      "default_unit": {
        "slug": "yes-no",
        "title": "Yes/No",
        "system": "enum",
        "choices": [
          {
            "text": "Yes",
            "descr": "Yes"
          },
          {
            "text": "No",
            "descr": "No"
          }
        ]
      },
      "ui_hint": "yes-no-comments",
      "answers": [],
      "candidates": [],
      "planned": [],
      "nb_respondents": 0,
      "rate": {},
      "opportunity": null
    }
  ]
}

Formats answers matching prefix

endpoint
GET /api/{profile}/sample/{sample}/content/{path}

The list returned contains at least one measurement for each question in the campaign. If there are no measurement yet on a question, measured will be null.

There might be more than one measurement per question as long as there are no duplicated unit per question. For example, to the question adjust-air-fuel-ratio, there could be a measurement with unit assessment (Mostly Yes/ Yes / No / Mostly No) and a measurement with unit freetext (i.e. a comment).

The {sample} must belong to {organization}.

{path} can be used to filter the tree of questions by a prefix.

Responses
count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

slug
string

Unique identifier that can be used in URL paths

path
string

path from the root of content tree

indent
string

level in the content tree

account
string

Account that can edit the page element

title
string

Title of the page element

picture
string

Picture icon that can be displayed alongside the title

extra
string

Extra meta data (can be stringify JSON)

default_unit
string

score_weight
string

rank
string

required
string

frozen
string

url
string

segments
array

ui_hint
string

text
string

answers
array

unit
string

Unit the measured field is in

measured
string

measurement in unit

created_at
string

Date/time of creation (in ISO format)

collected_by
string

User that collected the answer

candidates
array

unit
string

Unit the measured field is in

measured
string

measurement in unit

created_at
string

Date/time of creation (in ISO format)

collected_by
string

User that collected the answer

planned
array

unit
string

Unit the measured field is in

measured
string

measurement in unit

created_at
string

Date/time of creation (in ISO format)

collected_by
string

User that collected the answer

notes
array

unit
string

Unit the measured field is in

measured
string

measurement in unit

created_at
string

Date/time of creation (in ISO format)

collected_by
string

User that collected the answer

normalized_score
string

nb_respondents
string

rate
string

opportunity
string

 

Examples
curl http://localhost:8040/api/andy-shop/sample/f1e2e916eb494b90f9ff0a36982342/content/sustainability
responds
{
  "count": 4,
  "results": [
    {
      "count": 1,
      "slug": "sustainability",
      "path": "/sustainability",
      "indent": 0,
      "title": "Core Environment, Social and Governance (ESG) Assessment",
      "picture": null,
      "extra": {
        "pagebreak": true,
        "tags": [
          "scorecard"
        ],
        "visibility": [
          "public"
        ],
        "segments": [
          "/sustainability"
        ]
      },
      "rank": -1,
      "required": false,
      "default_unit": null,
      "ui_hint": null,
      "nb_respondents": 0,
      "rate": {},
      "opportunity": null
    },
    {
      "count": 1,
      "slug": "governance",
      "path": "/sustainability/governance",
      "indent": 1,
      "title": "Strategy & Governance",
      "picture": "/tspproject/static/img/management-basics.png",
      "extra": {
        "segments": [
          "/sustainability"
        ]
      },
      "rank": 1,
      "required": false,
      "default_unit": null,
      "ui_hint": null,
      "nb_respondents": 0,
      "rate": {},
      "opportunity": null
    },
    {
      "count": 1,
      "slug": "esg-strategy-heading",
      "path": "/sustainability/governance/esg-strategy-heading",
      "indent": 2,
      "title": "Environment, Social & Governance (ESG) Strategy",
      "picture": null,
      "extra": {
        "segments": [
          "/sustainability"
        ]
      },
      "rank": 1,
      "required": false,
      "default_unit": null,
      "ui_hint": null,
      "nb_respondents": 0,
      "rate": {},
      "opportunity": null
    },
    {
      "count": 1,
      "slug": "formalized-esg-strategy",
      "path": "/sustainability/governance/esg-strategy-heading/formalized-esg-strategy",
      "indent": 3,
      "title": "(3) Does your company have a formalized ESG strategy?",
      "picture": "/tspproject/static/img/management-basics.png",
      "extra": {
        "segments": [
          "/sustainability"
        ]
      },
      "rank": 4,
      "required": true,
      "default_unit": {
        "slug": "yes-no",
        "title": "Yes/No",
        "system": "enum",
        "choices": [
          {
            "text": "Yes",
            "descr": "Yes"
          },
          {
            "text": "No",
            "descr": "No"
          }
        ]
      },
      "ui_hint": "yes-no-comments",
      "answers": [],
      "candidates": [],
      "planned": [],
      "nb_respondents": 0,
      "rate": {},
      "opportunity": null
    }
  ]
}

Freezes answers

endpoint
POST /api/{profile}/sample/{sample}/freeze

A frozen sample cannot be edited to add and/or update answers.

Request body
grantees
array

Profiles with which sample was shared

Responses
campaign
object

Campaign this sample is part of

slug
string

Unique identifier that can be used in a URL

account
string

Account this sample belongs to.

title
string

Title of the campaign as displayed in user interfaces

description
string

Long form description displayed to users responding to the campaign

created_at
string

active
boolean

Whether the campaign is available or not

slug
string

Unique identifier for the sample. It can be used in a URL.

account
string

Account this sample belongs to

created_at
string

Date/time of creation (in ISO format)

updated_at
string

Date/time of last update (in ISO format)

is_frozen
boolean

When True, answers to that sample cannot be updated.

location
string

URL at which the response is visible

grantees
array

Profiles with which sample was shared

 

Examples
curl -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{}' http://localhost:8040/api/supplier-1/sample/0123456789abcdef/freeze
responds
{
  "slug": "0123456789abcdef",
  "account": "supplier-1",
  "created_at": "2020-01-01T00:00:00Z",
  "is_frozen": true,
  "campaign": null,
  "updated_at": "2020-01-01T00:00:00Z"
}

Freezes answers matching prefix

endpoint
POST /api/{profile}/sample/{sample}/freeze/{path}

A frozen sample cannot be edited to add and/or update answers.

Request body
grantees
array

Profiles with which sample was shared

Responses
campaign
object

Campaign this sample is part of

slug
string

Unique identifier that can be used in a URL

account
string

Account this sample belongs to.

title
string

Title of the campaign as displayed in user interfaces

description
string

Long form description displayed to users responding to the campaign

created_at
string

active
boolean

Whether the campaign is available or not

slug
string

Unique identifier for the sample. It can be used in a URL.

account
string

Account this sample belongs to

created_at
string

Date/time of creation (in ISO format)

updated_at
string

Date/time of last update (in ISO format)

is_frozen
boolean

When True, answers to that sample cannot be updated.

location
string

URL at which the response is visible

grantees
array

Profiles with which sample was shared

 

Examples
curl -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{}' http://localhost:8040/api/supplier-1/sample/0123456789abcdef/freeze/construction
responds
{
  "slug": "0123456789abcdef",
  "account": "supplier-1",
  "created_at": "2020-01-01T00:00:00Z",
  "is_frozen": true,
  "campaign": null,
  "updated_at": "2020-01-01T00:00:00Z"
}

Clears answers

endpoint
POST /api/{profile}/sample/{sample}/reset

The sample must belong to organization.

path can be used to filter the tree of questions by a prefix.

Request body
grantees
array

Profiles with which sample was shared

Responses
campaign
object

Campaign this sample is part of

slug
string

Unique identifier that can be used in a URL

account
string

Account this sample belongs to.

title
string

Title of the campaign as displayed in user interfaces

description
string

Long form description displayed to users responding to the campaign

created_at
string

active
boolean

Whether the campaign is available or not

slug
string

Unique identifier for the sample. It can be used in a URL.

account
string

Account this sample belongs to

created_at
string

Date/time of creation (in ISO format)

updated_at
string

Date/time of last update (in ISO format)

is_frozen
boolean

When True, answers to that sample cannot be updated.

location
string

URL at which the response is visible

grantees
array

Profiles with which sample was shared

 

Examples
curl -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{}' http://localhost:8040/api/supplier-1/sample/46f66f70f5ad41b29c4df08f683a9a7a/reset
responds
{
  "slug": "46f66f70f5ad41b29c4df08f683a9a7a",
  "created_at": "2018-01-24T17:03:34.926193Z",
  "campaign": "sustainability"
}

Clears answers matching prefix

endpoint
POST /api/{profile}/sample/{sample}/reset/{path}

The sample must belong to organization.

path can be used to filter the tree of questions by a prefix.

Request body
grantees
array

Profiles with which sample was shared

Responses
campaign
object

Campaign this sample is part of

slug
string

Unique identifier that can be used in a URL

account
string

Account this sample belongs to.

title
string

Title of the campaign as displayed in user interfaces

description
string

Long form description displayed to users responding to the campaign

created_at
string

active
boolean

Whether the campaign is available or not

slug
string

Unique identifier for the sample. It can be used in a URL.

account
string

Account this sample belongs to

created_at
string

Date/time of creation (in ISO format)

updated_at
string

Date/time of last update (in ISO format)

is_frozen
boolean

When True, answers to that sample cannot be updated.

location
string

URL at which the response is visible

grantees
array

Profiles with which sample was shared

 

Examples
curl -X POST -H 'Content-Type: application/json; charset=UTF-8' -d '{}' http://localhost:8040/api/supplier-1/sample/46f66f70f5ad41b29c4df08f683a9a7a/reset/construction
responds
{
  "slug": "46f66f70f5ad41b29c4df08f683a9a7a",
  "created_at": "2018-01-24T17:03:34.926193Z",
  "campaign": "sustainability"
}

Lists respondents

endpoint
GET /api/{profile}/sample/{sample}/respondents

The list returned contains the information about the users who answered at least one question.

The {sample} must belong to {organization}.

{path} can be used to filter the tree of questions by a prefix.

Query parameters
page
integer

A page number within the paginated result set.

Responses
count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

slug
string

Effectively the username. The variable is named `slug` such that front-end code can be re-used between Organization and User records.

email
string

E-mail address for the user

full_name
string

Full name for the contact (effectively first name followed by last name)

created_at
string

Date/time of creation (in ISO format)

last_login
string

Date/time of last login (in ISO format)

 

Examples
curl http://localhost:8040/api/supplier-1/sample/46f66f70f5ad41b29c4df08f683a9a7a/respondents
responds
{
  "count": 1,
  "previous": null,
  "next": null,
  "results": [
    {
      "slug": "steve",
      "full_name": "Steve"
    }
  ]
}

Lists respondents matching prefix

endpoint
GET /api/{profile}/sample/{sample}/respondents/{path}

The list returned contains the information about the users who answered at least one question.

The {sample} must belong to {organization}.

{path} can be used to filter the tree of questions by a prefix.

Responses
count
integer

Total number of items in the dataset

previous
string

URL to previous page of results

next
string

URL to next page of results

results
array

items in current page

slug
string

Effectively the username. The variable is named `slug` such that front-end code can be re-used between Organization and User records.

email
string

E-mail address for the user

full_name
string

Full name for the contact (effectively first name followed by last name)

created_at
string

Date/time of creation (in ISO format)

last_login
string

Date/time of last login (in ISO format)

 

Examples
curl http://localhost:8040/api/supplier-1/sample/46f66f70f5ad41b29c4df08f683a9a7a/respondents/construction
responds
{
  "count": 1,
  "previous": null,
  "next": null,
  "results": [
    {
      "slug": "steve",
      "full_name": "Steve"
    }
  ]
}