discussions

Discussion related operations

List all Discussions

GET//www.data.gouv.fr/api/1/discussions/
Query parameters
Header parameters
Response

Success

Body
dataarray of Discussion (object)

The page data

next_pagestring

The next page URL if exists

page*integer

The current page

page_size*integer

The page size used for pagination

previous_pagestring

The previous page URL if exists

total*integer

The total paginated items

Request
const response = await fetch('//www.data.gouv.fr/api/1/discussions/', {
    method: 'GET',
    headers: {},
});
const data = await response.json();
Response
{
  "data": [
    {
      "class": "text",
      "closed": "2024-10-23T15:22:03.976Z",
      "closed_by": {
        "class": "text",
        "id": "text",
        "avatar": "text",
        "avatar_thumbnail": "text",
        "first_name": "text",
        "last_name": "text",
        "page": "text",
        "slug": "text",
        "uri": "text"
      },
      "created": "2024-10-23T15:22:03.976Z",
      "discussion": {
        "content": "text",
        "posted_by": {
          "class": "text",
          "id": "text",
          "avatar": "text",
          "avatar_thumbnail": "text",
          "first_name": "text",
          "last_name": "text",
          "page": "text",
          "slug": "text",
          "uri": "text"
        },
        "posted_on": "2024-10-23T15:22:03.976Z",
        "spam": {
          "status": "not_checked"
        }
      },
      "id": "text",
      "spam": {
        "status": "not_checked"
      },
      "subject": {
        "class": "text",
        "id": "text"
      },
      "title": "text",
      "url": "text",
      "user": {
        "class": "text",
        "id": "text",
        "avatar": "text",
        "avatar_thumbnail": "text",
        "first_name": "text",
        "last_name": "text",
        "page": "text",
        "slug": "text",
        "uri": "text"
      }
    }
  ],
  "next_page": "text",
  "previous_page": "text"
}

Create a new Discussion

POST//www.data.gouv.fr/api/1/discussions/
Header parameters
Body
comment*string

The content of the initial comment

extrasobject

Extras attributes as key-value pairs

subject*all of

The discussion target object

title*string

The title of the discussion to open

Response

Success

Body
class*string

The object class

closedstring (date-time)

The discussion closing date

closed_byall of

The user who closed the discussion

createdstring (date-time)

The discussion creation date

discussionDiscussionMessage (object)
extrasobject

Extra attributes as key-value pairs

idstring

The discussion identifier

spamSpam (object)
subjectall of

The discussion target object

titlestring

The discussion title

urlstring

The discussion API URI

userall of

The discussion author

Request
const response = await fetch('//www.data.gouv.fr/api/1/discussions/', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "comment": "text",
      "subject": {
        "class": "text",
        "id": "text"
      },
      "title": "text"
    }),
});
const data = await response.json();
Response
{
  "class": "text",
  "closed": "2024-10-23T15:22:03.976Z",
  "closed_by": {
    "class": "text",
    "id": "text",
    "avatar": "text",
    "avatar_thumbnail": "text",
    "first_name": "text",
    "last_name": "text",
    "page": "text",
    "slug": "text",
    "uri": "text"
  },
  "created": "2024-10-23T15:22:03.976Z",
  "discussion": {
    "content": "text",
    "posted_by": {
      "class": "text",
      "id": "text",
      "avatar": "text",
      "avatar_thumbnail": "text",
      "first_name": "text",
      "last_name": "text",
      "page": "text",
      "slug": "text",
      "uri": "text"
    },
    "posted_on": "2024-10-23T15:22:03.976Z",
    "spam": {
      "status": "not_checked"
    }
  },
  "id": "text",
  "spam": {
    "status": "not_checked"
  },
  "subject": {
    "class": "text",
    "id": "text"
  },
  "title": "text",
  "url": "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//www.data.gouv.fr/api/1/discussions/{id}/
Path parameters
id*string
Header parameters
Response

Success

Body
class*string

The object class

closedstring (date-time)

The discussion closing date

closed_byall of

The user who closed the discussion

createdstring (date-time)

The discussion creation date

discussionDiscussionMessage (object)
extrasobject

Extra attributes as key-value pairs

idstring

The discussion identifier

spamSpam (object)
subjectall of

The discussion target object

titlestring

The discussion title

urlstring

The discussion API URI

userall of

The discussion author

Request
const response = await fetch('//www.data.gouv.fr/api/1/discussions/{id}/', {
    method: 'GET',
    headers: {},
});
const data = await response.json();
Response
{
  "class": "text",
  "closed": "2024-10-23T15:22:03.976Z",
  "closed_by": {
    "class": "text",
    "id": "text",
    "avatar": "text",
    "avatar_thumbnail": "text",
    "first_name": "text",
    "last_name": "text",
    "page": "text",
    "slug": "text",
    "uri": "text"
  },
  "created": "2024-10-23T15:22:03.976Z",
  "discussion": {
    "content": "text",
    "posted_by": {
      "class": "text",
      "id": "text",
      "avatar": "text",
      "avatar_thumbnail": "text",
      "first_name": "text",
      "last_name": "text",
      "page": "text",
      "slug": "text",
      "uri": "text"
    },
    "posted_on": "2024-10-23T15:22:03.976Z",
    "spam": {
      "status": "not_checked"
    }
  },
  "id": "text",
  "spam": {
    "status": "not_checked"
  },
  "subject": {
    "class": "text",
    "id": "text"
  },
  "title": "text",
  "url": "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//www.data.gouv.fr/api/1/discussions/{id}/
Path parameters
id*string
Header parameters
Body
closeboolean

Is this a closing response. Only subject owner can close

comment*string

The comment to submit

Response

Success

Body
class*string

The object class

closedstring (date-time)

The discussion closing date

closed_byall of

The user who closed the discussion

createdstring (date-time)

The discussion creation date

discussionDiscussionMessage (object)
extrasobject

Extra attributes as key-value pairs

idstring

The discussion identifier

spamSpam (object)
subjectall of

The discussion target object

titlestring

The discussion title

urlstring

The discussion API URI

userall of

The discussion author

Request
const response = await fetch('//www.data.gouv.fr/api/1/discussions/{id}/', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "comment": "text"
    }),
});
const data = await response.json();
Response
{
  "class": "text",
  "closed": "2024-10-23T15:22:03.976Z",
  "closed_by": {
    "class": "text",
    "id": "text",
    "avatar": "text",
    "avatar_thumbnail": "text",
    "first_name": "text",
    "last_name": "text",
    "page": "text",
    "slug": "text",
    "uri": "text"
  },
  "created": "2024-10-23T15:22:03.976Z",
  "discussion": {
    "content": "text",
    "posted_by": {
      "class": "text",
      "id": "text",
      "avatar": "text",
      "avatar_thumbnail": "text",
      "first_name": "text",
      "last_name": "text",
      "page": "text",
      "slug": "text",
      "uri": "text"
    },
    "posted_on": "2024-10-23T15:22:03.976Z",
    "spam": {
      "status": "not_checked"
    }
  },
  "id": "text",
  "spam": {
    "status": "not_checked"
  },
  "subject": {
    "class": "text",
    "id": "text"
  },
  "title": "text",
  "url": "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//www.data.gouv.fr/api/1/discussions/{id}/
Path parameters
id*string
Response

Not allowed to delete this discussion

Request
const response = await fetch('//www.data.gouv.fr/api/1/discussions/{id}/', {
    method: 'DELETE',
    headers: {},
});
const data = await response.json();

Delete a comment given its index

DELETE//www.data.gouv.fr/api/1/discussions/{id}/comments/{cidx}
Path parameters
id*string
cidx*integer
Response

Not allowed to delete this comment

Request
const response = await fetch('//www.data.gouv.fr/api/1/discussions/{id}/comments/{cidx}', {
    method: 'DELETE',
    headers: {},
});
const data = await response.json();

Dernière mise à jour

Revision created

Update faq-cadastre.md