live_help Notes

chrome_reader_mode This resource is paginated by 30 items

settings Params

Param name Description
topic_id optional . Must be String

The topic id

message_id optional . Must be String

The message id

user_id optional . Must be String

The user id or slug

sort optional . Must be one of: id, author_id, content, content_html, parent_id, created_at, updated_at, reference_id, deleted_at, is_root, messageable_type, messageable_id, write_at, readings_count.

The sort field. Sorted by created_at asc by default.

Example:

To sort on messages on the fields write_at on a descending order and readings_count on a ascending order:

...&sort=-write_at,readings_count

filter optional . Must be one of: id, author_id, content, content_html, parent_id, created_at, updated_at, reference_id, deleted_at, is_root, messageable_type, messageable_id, write_at, readings_count, deleted, write.

Filtering on one or more fields

Example:

To filter on messages with the id field matching a_value or another_value:

...&filter[id]=a_value,another_value

Filterable fields:
  • id (standard field)
  • author_id (standard field)
  • content (standard field)
  • content_html (standard field)
  • parent_id (standard field)
  • created_at (standard field)
  • updated_at (standard field)
  • reference_id (standard field)
  • deleted_at (standard field)
  • is_root (standard field)
  • messageable_type (standard field)
  • messageable_id (standard field)
  • write_at (standard field)
  • readings_count (standard field)
  • deleted (standard field)
  • write (standard field)
range optional . Must be one of: id, author_id, content, content_html, parent_id, created_at, updated_at, reference_id, deleted_at, is_root, messageable_type, messageable_id, write_at, readings_count.

Select on a particular range

Example:

To range on messages with the readings_count field between min_value and max_value:

...&range[readings_count]=min_value,max_value

Rangeable fields:
  • id
  • author_id
  • content
  • content_html
  • parent_id
  • created_at
  • updated_at
  • reference_id
  • deleted_at
  • is_root
  • messageable_type
  • messageable_id
  • write_at
  • readings_count
page optional . Must be a Hash

The pagination params, as a hash

page[number] optional . Must be Fixnum

The current page

page[size] optional . Must be Fixnum

The number of items per page, defaults to 30, maximum 100

comments powered by <span class='logo-disqus'>Disqus</span>
GET /v2/messages
200
[
  {
    "id": 1,
    "author": {
      "id": 20,
      "login": "pamidala",
      "url": "https://api.intra.42.fr/v2/users/pamidala"
    },
    "content": "Cliche seitan hella post-ironic chicharrones everyday chia health. Wolf intelligentsia vice polaroid carry. Sustainable chillwave asymmetrical church-key pour-over letterpress.\nEthical tacos leggings vegan sriracha. Helvetica kogi master chillwave forage kinfolk williamsburg. Bushwick kinfolk bitters echo crucifix salvia. Kickstarter semiotics park cold-pressed. Cornhole stumptown pitchfork hammock tousled chambray meggings twee.\nVegan typewriter marfa helvetica portland. Squid ethical neutra cold-pressed tumblr. Everyday vice umami. Shabby chic vice chartreuse keffiyeh umami migas pop-up. Sriracha lomo cred 90's typewriter selvage fanny pack.",
    "content_html": null,
    "replies": [
      {
        "id": 10,
        "author": {
          "id": 63,
          "login": "bhutt",
          "url": "https://api.intra.42.fr/v2/users/bhutt"
        },
        "content": "+1 artisan sartorial. Aesthetic venmo banh mi fixie chia. Chia ramps asymmetrical quinoa disrupt. Yuccie umami photo booth green juice chicharrones blog raw denim. Chartreuse etsy pug thundercats pour-over celiac.\nBitters bushwick waistcoat intelligentsia whatever mumblecore gentrify. Wes anderson lomo artisan mustache. Sriracha salvia cliche. Church-key craft beer austin shoreditch wes anderson swag literally try-hard.\nShabby chic typewriter kogi green juice kitsch swag. Narwhal neutra cold-pressed crucifix single-origin coffee readymade. Ramps ethical fanny pack semiotics cray. Banh mi tousled vhs craft beer cronut truffaut fingerstache paleo.",
        "content_html": null,
        "replies": [],
        "created_at": "2017-03-06T14:59:38.554Z",
        "updated_at": "2017-03-06T14:59:38.554Z",
        "parent_id": 1,
        "is_root": false,
        "messageable_id": 1,
        "messageable_type": "Topic",
        "votes_count": {
          "upvote": 0,
          "downvote": 0,
          "trollvote": 0,
          "problem": 0
        },
        "user_votes": {
          "upvote": false,
          "downvote": false,
          "trollvote": false,
          "problem": false
        },
        "readings": 0
      }
    ],
    "created_at": "2017-03-06T14:59:37.766Z",
    "updated_at": "2017-03-06T14:59:38.575Z",
    "parent_id": null,
    "is_root": true,
    "messageable_id": 1,
    "messageable_type": "Topic",
    "votes_count": {
      "upvote": 0,
      "downvote": 0,
      "trollvote": 0,
      "problem": 0
    },
    "user_votes": {
      "upvote": false,
      "downvote": false,
      "trollvote": false,
      "problem": false
    },
    "readings": 0
  },
  {
    "id": 2,
    "author": {
      "id": 1,
      "login": "jeanne",
      "url": "https://api.intra.42.fr/v2/users/jeanne"
    },
    "content": "Tilde cornhole plaid gluten-free hashtag meditation tumblr stumptown. Taxidermy poutine chia fanny pack. Literally forage small batch narwhal.\nButcher blog literally. Polaroid paleo crucifix. Seitan organic waistcoat narwhal intelligentsia ethical hashtag. Synth try-hard keffiyeh. Franzen leggings health biodiesel salvia blue bottle fanny pack chia.\nArt party tumblr cornhole chia +1 disrupt. Green juice dreamcatcher cardigan pitchfork freegan cold-pressed. Lomo listicle mlkshk franzen kombucha vinegar tilde. Letterpress scenester normcore try-hard fashion axe chillwave. Loko franzen banjo occupy cronut 90's twee.",
    "content_html": null,
    "replies": [
      {
        "id": 8,
        "author": {
          "id": 6,
          "login": "qbollach",
          "url": "https://api.intra.42.fr/v2/users/qbollach"
        },
        "content": "Lomo gluten-free beard yolo neutra. Pug cardigan fashion axe yr portland viral. Green juice tofu seitan craft beer banjo. Williamsburg deep v post-ironic 3 wolf moon.\nHealth post-ironic next level lo-fi. Kale chips tumblr vice trust fund lo-fi farm-to-table tofu. Irony chicharrones pour-over wes anderson five dollar toast tacos bicycle rights. Green juice leggings direct trade tumblr forage wes anderson single-origin coffee.\nLoko tofu ennui sriracha cold-pressed meditation freegan selvage. Chartreuse street godard kickstarter pop-up. Microdosing art party chartreuse single-origin coffee williamsburg quinoa squid. Twee humblebrag synth iphone. Pop-up cred intelligentsia ethical.",
        "content_html": null,
        "replies": [],
        "created_at": "2017-03-06T14:59:38.248Z",
        "updated_at": "2017-03-06T14:59:38.248Z",
        "parent_id": 2,
        "is_root": false,
        "messageable_id": 1,
        "messageable_type": "Topic",
        "votes_count": {
          "upvote": 0,
          "downvote": 0,
          "trollvote": 0,
          "problem": 0
        },
        "user_votes": {
          "upvote": false,
          "downvote": false,
          "trollvote": false,
          "problem": false
        },
        "readings": 0
      }
    ],
    "created_at": "2017-03-06T14:59:37.878Z",
    "updated_at": "2017-03-06T14:59:38.273Z",
    "parent_id": null,
    "is_root": false,
    "messageable_id": 1,
    "messageable_type": "Topic",
    "votes_count": {
      "upvote": 0,
      "downvote": 0,
      "trollvote": 0,
      "problem": 0
    },
    "user_votes": {
      "upvote": false,
      "downvote": false,
      "trollvote": false,
      "problem": false
    },
    "readings": 0
  },
  {
    "id": 3,
    "author": {
      "id": 47,
      "login": "baorgana",
      "url": "https://api.intra.42.fr/v2/users/baorgana"
    },
    "content": "Direct trade green juice williamsburg yr shabby chic. Locavore vice you probably haven't heard of them pour-over raw denim. Umami tacos beard hella +1 locavore diy slow-carb. Crucifix viral stumptown heirloom yuccie.\nLeggings hella food truck ugh seitan. Street post-ironic tousled meh bushwick try-hard. Bespoke butcher flexitarian.\nArtisan irony chicharrones schlitz hella meditation. Venmo synth umami meditation asymmetrical. +1 street shoreditch selvage williamsburg fanny pack mustache chia. Cleanse 3 wolf moon lumbersexual ramps green juice.",
    "content_html": null,
    "replies": [],
    "created_at": "2017-03-06T14:59:37.948Z",
    "updated_at": "2017-03-06T14:59:37.948Z",
    "parent_id": null,
    "is_root": false,
    "messageable_id": 1,
    "messageable_type": "Topic",
    "votes_count": {
      "upvote": 0,
      "downvote": 0,
      "trollvote": 0,
      "problem": 0
    },
    "user_votes": {
      "upvote": false,
      "downvote": false,
      "trollvote": false,
      "problem": false
    },
    "readings": 0
  }
]
curl  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" "https://api.intra.42.fr/v2/messages"

[
  {
    "id": 1,
    "author": {
      "id": 20,
      "login": "pamidala",
      "url": "https://api.intra.42.fr/v2/users/pamidala"
    },
    "content": "Cliche seitan hella post-ironic chicharrones everyday chia health. Wolf intelligentsia vice polaroid carry. Sustainable chillwave asymmetrical church-key pour-over letterpress.\nEthical tacos leggings vegan sriracha. Helvetica kogi master chillwave forage kinfolk williamsburg. Bushwick kinfolk bitters echo crucifix salvia. Kickstarter semiotics park cold-pressed. Cornhole stumptown pitchfork hammock tousled chambray meggings twee.\nVegan typewriter marfa helvetica portland. Squid ethical neutra cold-pressed tumblr. Everyday vice umami. Shabby chic vice chartreuse keffiyeh umami migas pop-up. Sriracha lomo cred 90's typewriter selvage fanny pack.",
    "content_html": null,
    "replies": [
      {
        "id": 10,
        "author": {
          "id": 63,
          "login": "bhutt",
          "url": "https://api.intra.42.fr/v2/users/bhutt"
        },
        "content": "+1 artisan sartorial. Aesthetic venmo banh mi fixie chia. Chia ramps asymmetrical quinoa disrupt. Yuccie umami photo booth green juice chicharrones blog raw denim. Chartreuse etsy pug thundercats pour-over celiac.\nBitters bushwick waistcoat intelligentsia whatever mumblecore gentrify. Wes anderson lomo artisan mustache. Sriracha salvia cliche. Church-key craft beer austin shoreditch wes anderson swag literally try-hard.\nShabby chic typewriter kogi green juice kitsch swag. Narwhal neutra cold-pressed crucifix single-origin coffee readymade. Ramps ethical fanny pack semiotics cray. Banh mi tousled vhs craft beer cronut truffaut fingerstache paleo.",
        "content_html": null,
        "replies": [],
        "created_at": "2017-03-06T14:59:38.554Z",
        "updated_at": "2017-03-06T14:59:38.554Z",
        "parent_id": 1,
        "is_root": false,
        "messageable_id": 1,
        "messageable_type": "Topic",
        "votes_count": {
          "upvote": 0,
          "downvote": 0,
          "trollvote": 0,
          "problem": 0
        },
        "user_votes": {
          "upvote": false,
          "downvote": false,
          "trollvote": false,
          "problem": false
        },
        "readings": 0
      }
    ],
    "created_at": "2017-03-06T14:59:37.766Z",
    "updated_at": "2017-03-06T14:59:38.575Z",
    "parent_id": null,
    "is_root": true,
    "messageable_id": 1,
    "messageable_type": "Topic",
    "votes_count": {
      "upvote": 0,
      "downvote": 0,
      "trollvote": 0,
      "problem": 0
    },
    "user_votes": {
      "upvote": false,
      "downvote": false,
      "trollvote": false,
      "problem": false
    },
    "readings": 0
  },
  {
    "id": 2,
    "author": {
      "id": 1,
      "login": "jeanne",
      "url": "https://api.intra.42.fr/v2/users/jeanne"
    },
    "content": "Tilde cornhole plaid gluten-free hashtag meditation tumblr stumptown. Taxidermy poutine chia fanny pack. Literally forage small batch narwhal.\nButcher blog literally. Polaroid paleo crucifix. Seitan organic waistcoat narwhal intelligentsia ethical hashtag. Synth try-hard keffiyeh. Franzen leggings health biodiesel salvia blue bottle fanny pack chia.\nArt party tumblr cornhole chia +1 disrupt. Green juice dreamcatcher cardigan pitchfork freegan cold-pressed. Lomo listicle mlkshk franzen kombucha vinegar tilde. Letterpress scenester normcore try-hard fashion axe chillwave. Loko franzen banjo occupy cronut 90's twee.",
    "content_html": null,
    "replies": [
      {
        "id": 8,
        "author": {
          "id": 6,
          "login": "qbollach",
          "url": "https://api.intra.42.fr/v2/users/qbollach"
        },
        "content": "Lomo gluten-free beard yolo neutra. Pug cardigan fashion axe yr portland viral. Green juice tofu seitan craft beer banjo. Williamsburg deep v post-ironic 3 wolf moon.\nHealth post-ironic next level lo-fi. Kale chips tumblr vice trust fund lo-fi farm-to-table tofu. Irony chicharrones pour-over wes anderson five dollar toast tacos bicycle rights. Green juice leggings direct trade tumblr forage wes anderson single-origin coffee.\nLoko tofu ennui sriracha cold-pressed meditation freegan selvage. Chartreuse street godard kickstarter pop-up. Microdosing art party chartreuse single-origin coffee williamsburg quinoa squid. Twee humblebrag synth iphone. Pop-up cred intelligentsia ethical.",
        "content_html": null,
        "replies": [],
        "created_at": "2017-03-06T14:59:38.248Z",
        "updated_at": "2017-03-06T14:59:38.248Z",
        "parent_id": 2,
        "is_root": false,
        "messageable_id": 1,
        "messageable_type": "Topic",
        "votes_count": {
          "upvote": 0,
          "downvote": 0,
          "trollvote": 0,
          "problem": 0
        },
        "user_votes": {
          "upvote": false,
          "downvote": false,
          "trollvote": false,
          "problem": false
        },
        "readings": 0
      }
    ],
    "created_at": "2017-03-06T14:59:37.878Z",
    "updated_at": "2017-03-06T14:59:38.273Z",
    "parent_id": null,
    "is_root": false,
    "messageable_id": 1,
    "messageable_type": "Topic",
    "votes_count": {
      "upvote": 0,
      "downvote": 0,
      "trollvote": 0,
      "problem": 0
    },
    "user_votes": {
      "upvote": false,
      "downvote": false,
      "trollvote": false,
      "problem": false
    },
    "readings": 0
  },
  {
    "id": 3,
    "author": {
      "id": 47,
      "login": "baorgana",
      "url": "https://api.intra.42.fr/v2/users/baorgana"
    },
    "content": "Direct trade green juice williamsburg yr shabby chic. Locavore vice you probably haven't heard of them pour-over raw denim. Umami tacos beard hella +1 locavore diy slow-carb. Crucifix viral stumptown heirloom yuccie.\nLeggings hella food truck ugh seitan. Street post-ironic tousled meh bushwick try-hard. Bespoke butcher flexitarian.\nArtisan irony chicharrones schlitz hella meditation. Venmo synth umami meditation asymmetrical. +1 street shoreditch selvage williamsburg fanny pack mustache chia. Cleanse 3 wolf moon lumbersexual ramps green juice.",
    "content_html": null,
    "replies": [],
    "created_at": "2017-03-06T14:59:37.948Z",
    "updated_at": "2017-03-06T14:59:37.948Z",
    "parent_id": null,
    "is_root": false,
    "messageable_id": 1,
    "messageable_type": "Topic",
    "votes_count": {
      "upvote": 0,
      "downvote": 0,
      "trollvote": 0,
      "problem": 0
    },
    "user_votes": {
      "upvote": false,
      "downvote": false,
      "trollvote": false,
      "problem": false
    },
    "readings": 0
  }
]
require "oauth2"
UID = "Your application uid"
SECRET = "Your application secret"
client = OAuth2::Client.new(UID, SECRET, site: "https://api.intra.42.fr")
token = client.client_credentials.get_token

response = token.get("/v2/messages")
response.status
# => 200
response.parsed
# => [{"id"=>1, "author"=>{"id"=>20, "login"=>"pamidala", "url"=>"https://api.intra.42.fr/v2/users/pamidala"}, "content"=>"Cliche seitan hella post-ironic chicharrones everyday chia health. Wolf intelligentsia vice polaroid carry. Sustainable chillwave asymmetrical church-key pour-over letterpress.\nEthical tacos leggings vegan sriracha. Helvetica kogi master chillwave forage kinfolk williamsburg. Bushwick kinfolk bitters echo crucifix salvia. Kickstarter semiotics park cold-pressed. Cornhole stumptown pitchfork hammock tousled chambray meggings twee.\nVegan typewriter marfa helvetica portland. Squid ethical neutra cold-pressed tumblr. Everyday vice umami. Shabby chic vice chartreuse keffiyeh umami migas pop-up. Sriracha lomo cred 90's typewriter selvage fanny pack.", "content_html"=>nil, "replies"=>[{"id"=>10, "author"=>{"id"=>63, "login"=>"bhutt", "url"=>"https://api.intra.42.fr/v2/users/bhutt"}, "content"=>"+1 artisan sartorial. Aesthetic venmo banh mi fixie chia. Chia ramps asymmetrical quinoa disrupt. Yuccie umami photo booth green juice chicharrones blog raw denim. Chartreuse etsy pug thundercats pour-over celiac.\nBitters bushwick waistcoat intelligentsia whatever mumblecore gentrify. Wes anderson lomo artisan mustache. Sriracha salvia cliche. Church-key craft beer austin shoreditch wes anderson swag literally try-hard.\nShabby chic typewriter kogi green juice kitsch swag. Narwhal neutra cold-pressed crucifix single-origin coffee readymade. Ramps ethical fanny pack semiotics cray. Banh mi tousled vhs craft beer cronut truffaut fingerstache paleo.", "content_html"=>nil, "replies"=>[], "created_at"=>"2017-03-06T14:59:38.554Z", "updated_at"=>"2017-03-06T14:59:38.554Z", "parent_id"=>1, "is_root"=>false, "messageable_id"=>1, "messageable_type"=>"Topic", "votes_count"=>{"upvote"=>0, "downvote"=>0, "trollvote"=>0, "problem"=>0}, "user_votes"=>{"upvote"=>false, "downvote"=>false, "trollvote"=>false, "problem"=>false}, "readings"=>0}], "created_at"=>"2017-03-06T14:59:37.766Z", "updated_at"=>"2017-03-06T14:59:38.575Z", "parent_id"=>nil, "is_root"=>true, "messageable_id"=>1, "messageable_type"=>"Topic", "votes_count"=>{"upvote"=>0, "downvote"=>0, "trollvote"=>0, "problem"=>0}, "user_votes"=>{"upvote"=>false, "downvote"=>false, "trollvote"=>false, "problem"=>false}, "readings"=>0}, {"id"=>2, "author"=>{"id"=>1, "login"=>"jeanne", "url"=>"https://api.intra.42.fr/v2/users/jeanne"}, "content"=>"Tilde cornhole plaid gluten-free hashtag meditation tumblr stumptown. Taxidermy poutine chia fanny pack. Literally forage small batch narwhal.\nButcher blog literally. Polaroid paleo crucifix. Seitan organic waistcoat narwhal intelligentsia ethical hashtag. Synth try-hard keffiyeh. Franzen leggings health biodiesel salvia blue bottle fanny pack chia.\nArt party tumblr cornhole chia +1 disrupt. Green juice dreamcatcher cardigan pitchfork freegan cold-pressed. Lomo listicle mlkshk franzen kombucha vinegar tilde. Letterpress scenester normcore try-hard fashion axe chillwave. Loko franzen banjo occupy cronut 90's twee.", "content_html"=>nil, "replies"=>[{"id"=>8, "author"=>{"id"=>6, "login"=>"qbollach", "url"=>"https://api.intra.42.fr/v2/users/qbollach"}, "content"=>"Lomo gluten-free beard yolo neutra. Pug cardigan fashion axe yr portland viral. Green juice tofu seitan craft beer banjo. Williamsburg deep v post-ironic 3 wolf moon.\nHealth post-ironic next level lo-fi. Kale chips tumblr vice trust fund lo-fi farm-to-table tofu. Irony chicharrones pour-over wes anderson five dollar toast tacos bicycle rights. Green juice leggings direct trade tumblr forage wes anderson single-origin coffee.\nLoko tofu ennui sriracha cold-pressed meditation freegan selvage. Chartreuse street godard kickstarter pop-up. Microdosing art party chartreuse single-origin coffee williamsburg quinoa squid. Twee humblebrag synth iphone. Pop-up cred intelligentsia ethical.", "content_html"=>nil, "replies"=>[], "created_at"=>"2017-03-06T14:59:38.248Z", "updated_at"=>"2017-03-06T14:59:38.248Z", "parent_id"=>2, "is_root"=>false, "messageable_id"=>1, "messageable_type"=>"Topic", "votes_count"=>{"upvote"=>0, "downvote"=>0, "trollvote"=>0, "problem"=>0}, "user_votes"=>{"upvote"=>false, "downvote"=>false, "trollvote"=>false, "problem"=>false}, "readings"=>0}], "created_at"=>"2017-03-06T14:59:37.878Z", "updated_at"=>"2017-03-06T14:59:38.273Z", "parent_id"=>nil, "is_root"=>false, "messageable_id"=>1, "messageable_type"=>"Topic", "votes_count"=>{"upvote"=>0, "downvote"=>0, "trollvote"=>0, "problem"=>0}, "user_votes"=>{"upvote"=>false, "downvote"=>false, "trollvote"=>false, "problem"=>false}, "readings"=>0}, {"id"=>3, "author"=>{"id"=>47, "login"=>"baorgana", "url"=>"https://api.intra.42.fr/v2/users/baorgana"}, "content"=>"Direct trade green juice williamsburg yr shabby chic. Locavore vice you probably haven't heard of them pour-over raw denim. Umami tacos beard hella +1 locavore diy slow-carb. Crucifix viral stumptown heirloom yuccie.\nLeggings hella food truck ugh seitan. Street post-ironic tousled meh bushwick try-hard. Bespoke butcher flexitarian.\nArtisan irony chicharrones schlitz hella meditation. Venmo synth umami meditation asymmetrical. +1 street shoreditch selvage williamsburg fanny pack mustache chia. Cleanse 3 wolf moon lumbersexual ramps green juice.", "content_html"=>nil, "replies"=>[], "created_at"=>"2017-03-06T14:59:37.948Z", "updated_at"=>"2017-03-06T14:59:37.948Z", "parent_id"=>nil, "is_root"=>false, "messageable_id"=>1, "messageable_type"=>"Topic", "votes_count"=>{"upvote"=>0, "downvote"=>0, "trollvote"=>0, "problem"=>0}, "user_votes"=>{"upvote"=>false, "downvote"=>false, "trollvote"=>false, "problem"=>false}, "readings"=>0}]