discussions

Discussion related operations

List all Discussions

get

/discussions/

Query parameters
sortstring · enum · default: -created

The field (and direction) on which sorting apply

Options: created, title, closed, discussion.posted_on, -created, -title, -closed, -discussion.posted_on
closedboolean

Filters discussions on their closed status if specified

forstring[]

Filter discussions for a given subject

orgstring

Filter discussions for a given organization

userstring

Filter discussions created by a user

pageinteger · default: 1

The page to fetch

page_sizeinteger · default: 20

The page size to fetch

Header parameters
X-Fieldsstring · mask

An optional fields mask

Responses
curl -L \
  --url '//www.data.gouv.fr/api/1/discussions/'
{
  "next_page": "text",
  "page": 1,
  "page_size": 1,
  "previous_page": "text",
  "total": 1,
  "data": [
    {
      "class": "text",
      "closed": "2025-02-22T13:41:51.020Z",
      "created": "2025-02-22T13:41:51.020Z",
      "discussion": {
        "content": "text",
        "posted_on": "2025-02-22T13:41:51.020Z",
        "spam": {
          "status": "not_checked"
        },
        "posted_by": {
          "class": "text",
          "id": "text",
          "avatar": "text",
          "avatar_thumbnail": "text",
          "first_name": "text",
          "last_name": "text",
          "page": "text",
          "slug": "text",
          "uri": "text"
        }
      },
      "extras": {},
      "id": "text",
      "spam": {
        "status": "not_checked"
      },
      "title": "text",
      "url": "text",
      "closed_by": {
        "class": "text",
        "id": "text",
        "avatar": "text",
        "avatar_thumbnail": "text",
        "first_name": "text",
        "last_name": "text",
        "page": "text",
        "slug": "text",
        "uri": "text"
      },
      "subject": {
        "class": "text",
        "id": "text"
      },
      "user": {
        "class": "text",
        "id": "text",
        "avatar": "text",
        "avatar_thumbnail": "text",
        "first_name": "text",
        "last_name": "text",
        "page": "text",
        "slug": "text",
        "uri": "text"
      }
    }
  ]
}

Create a new Discussion

post

/discussions/

Header parameters
X-Fieldsstring · mask

An optional fields mask

Body
commentstringrequired

The content of the initial comment

extrasobject

Extras attributes as key-value pairs

titlestringrequired

The title of the discussion to open

subjectall ofrequired

The discussion target object

Responses
curl -L \
  --request POST \
  --url '//www.data.gouv.fr/api/1/discussions/' \
  --header 'Content-Type: application/json' \
  --data '{"comment":"text","extras":{},"title":"text","subject":{"class":"text","id":"text"}}'
{
  "class": "text",
  "closed": "2025-02-22T13:41:51.020Z",
  "created": "2025-02-22T13:41:51.020Z",
  "discussion": {
    "content": "text",
    "posted_on": "2025-02-22T13:41:51.020Z",
    "spam": {
      "status": "not_checked"
    },
    "posted_by": {
      "class": "text",
      "id": "text",
      "avatar": "text",
      "avatar_thumbnail": "text",
      "first_name": "text",
      "last_name": "text",
      "page": "text",
      "slug": "text",
      "uri": "text"
    }
  },
  "extras": {},
  "id": "text",
  "spam": {
    "status": "not_checked"
  },
  "title": "text",
  "url": "text",
  "closed_by": {
    "class": "text",
    "id": "text",
    "avatar": "text",
    "avatar_thumbnail": "text",
    "first_name": "text",
    "last_name": "text",
    "page": "text",
    "slug": "text",
    "uri": "text"
  },
  "subject": {
    "class": "text",
    "id": "text"
  },
  "user": {
    "class": "text",
    "id": "text",
    "avatar": "text",
    "avatar_thumbnail": "text",
    "first_name": "text",
    "last_name": "text",
    "page": "text",
    "slug": "text",
    "uri": "text"
  }
}

Get a discussion given its ID

get

/discussions/{id}//

Path parameters
idstringrequired
Header parameters
X-Fieldsstring · mask

An optional fields mask

Responses
curl -L \
  --url '//www.data.gouv.fr/api/1/discussions/{id}/'
{
  "class": "text",
  "closed": "2025-02-22T13:41:51.020Z",
  "created": "2025-02-22T13:41:51.020Z",
  "discussion": {
    "content": "text",
    "posted_on": "2025-02-22T13:41:51.020Z",
    "spam": {
      "status": "not_checked"
    },
    "posted_by": {
      "class": "text",
      "id": "text",
      "avatar": "text",
      "avatar_thumbnail": "text",
      "first_name": "text",
      "last_name": "text",
      "page": "text",
      "slug": "text",
      "uri": "text"
    }
  },
  "extras": {},
  "id": "text",
  "spam": {
    "status": "not_checked"
  },
  "title": "text",
  "url": "text",
  "closed_by": {
    "class": "text",
    "id": "text",
    "avatar": "text",
    "avatar_thumbnail": "text",
    "first_name": "text",
    "last_name": "text",
    "page": "text",
    "slug": "text",
    "uri": "text"
  },
  "subject": {
    "class": "text",
    "id": "text"
  },
  "user": {
    "class": "text",
    "id": "text",
    "avatar": "text",
    "avatar_thumbnail": "text",
    "first_name": "text",
    "last_name": "text",
    "page": "text",
    "slug": "text",
    "uri": "text"
  }
}

Add comment and optionally close a discussion given its ID

post

/discussions/{id}//

Path parameters
idstringrequired
Header parameters
X-Fieldsstring · mask

An optional fields mask

Body
closeboolean

Is this a closing response. Only subject owner can close

commentstringrequired

The comment to submit

Responses
curl -L \
  --request POST \
  --url '//www.data.gouv.fr/api/1/discussions/{id}/' \
  --header 'Content-Type: application/json' \
  --data '{"comment":"text"}'
{
  "class": "text",
  "closed": "2025-02-22T13:41:51.020Z",
  "created": "2025-02-22T13:41:51.020Z",
  "discussion": {
    "content": "text",
    "posted_on": "2025-02-22T13:41:51.020Z",
    "spam": {
      "status": "not_checked"
    },
    "posted_by": {
      "class": "text",
      "id": "text",
      "avatar": "text",
      "avatar_thumbnail": "text",
      "first_name": "text",
      "last_name": "text",
      "page": "text",
      "slug": "text",
      "uri": "text"
    }
  },
  "extras": {},
  "id": "text",
  "spam": {
    "status": "not_checked"
  },
  "title": "text",
  "url": "text",
  "closed_by": {
    "class": "text",
    "id": "text",
    "avatar": "text",
    "avatar_thumbnail": "text",
    "first_name": "text",
    "last_name": "text",
    "page": "text",
    "slug": "text",
    "uri": "text"
  },
  "subject": {
    "class": "text",
    "id": "text"
  },
  "user": {
    "class": "text",
    "id": "text",
    "avatar": "text",
    "avatar_thumbnail": "text",
    "first_name": "text",
    "last_name": "text",
    "page": "text",
    "slug": "text",
    "uri": "text"
  }
}

Delete a discussion given its ID

delete

/discussions/{id}//

Path parameters
idstringrequired
Responses
curl -L \
  --request DELETE \
  --url '//www.data.gouv.fr/api/1/discussions/{id}/'

No body

Delete a comment given its index

delete

/discussions/{id}/comments/{cidx}

Path parameters
idstringrequired
cidxintegerrequired
Responses
curl -L \
  --request DELETE \
  --url '//www.data.gouv.fr/api/1/discussions/{id}/comments/{cidx}'

No body

Dernière mise à jour

Cet article vous a-t-il été utile ?


Revision created

Update faq-cadastre.md