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": 110,
      "login": "sebusebu",
      "url": "https://api.intra.42.fr/v2/users/sebusebu"
    },
    "content": "Five dollar toast freegan kickstarter. Blue bottle swag pitchfork cornhole schlitz. Fashion axe pbr&b austin. Ethical echo deep v. Fashion axe franzen twee organic vegan marfa authentic tilde.\nWayfarers direct trade tofu bespoke tilde portland plaid messenger bag. Jean shorts locavore tousled fanny pack freegan. Normcore gluten-free franzen plaid irony.\nSynth irony retro single-origin coffee squid meggings. Street trust fund disrupt iphone keffiyeh 90's lo-fi heirloom. Beard disrupt pitchfork. Craft beer vegan butcher keffiyeh mumblecore gentrify pickled tacos.",
    "content_html": null,
    "replies": [],
    "created_at": "2017-11-22T13:42:13.269Z",
    "updated_at": "2017-11-22T13:42:13.269Z",
    "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": 80,
      "login": "yyoda2",
      "url": "https://api.intra.42.fr/v2/users/yyoda2"
    },
    "content": "Hammock helvetica retro before they sold out kogi franzen taxidermy swag. Austin ramps goth actually wayfarers food truck pinterest. Knausgaard yolo chambray hashtag tacos whatever.\n90's fixie yolo typewriter schlitz drinking +1. Lo-fi tousled hashtag distillery mlkshk health kinfolk. Ugh brooklyn mustache actually health selfies post-ironic normcore. Shoreditch wes anderson gluten-free butcher whatever.\nNeutra waistcoat williamsburg put a bird on it cold-pressed yuccie keytar. Poutine offal schlitz tacos etsy pbr&b godard. Pickled forage kombucha schlitz truffaut dreamcatcher intelligentsia echo.",
    "content_html": null,
    "replies": [],
    "created_at": "2017-11-22T13:42:13.332Z",
    "updated_at": "2017-11-22T13:42:20.055Z",
    "parent_id": null,
    "is_root": false,
    "messageable_id": 1,
    "messageable_type": "Topic",
    "votes_count": {
      "upvote": 0,
      "downvote": 0,
      "trollvote": 1,
      "problem": 0
    },
    "user_votes": {
      "upvote": false,
      "downvote": false,
      "trollvote": false,
      "problem": false
    },
    "readings": 0
  },
  {
    "id": 3,
    "author": {
      "id": 87,
      "login": "wedantil",
      "url": "https://api.intra.42.fr/v2/users/wedantil"
    },
    "content": "Blog taxidermy tilde iphone sustainable. Yolo cold-pressed pinterest single-origin coffee brooklyn chicharrones knausgaard loko. Leggings gentrify venmo.\nVenmo wes anderson meggings mustache fashion axe. 8-bit meggings microdosing fixie kogi wayfarers. Everyday shabby chic shoreditch scenester plaid meggings pork belly 90's.\nIrony sustainable cardigan pour-over everyday marfa stumptown. Synth everyday pop-up +1 mumblecore readymade gastropub. Waistcoat literally cold-pressed. 3 wolf moon keytar swag hashtag. Cred lo-fi put a bird on it.",
    "content_html": null,
    "replies": [
      {
        "id": 8,
        "author": {
          "id": 98,
          "login": "okenobi",
          "url": "https://api.intra.42.fr/v2/users/okenobi"
        },
        "content": "Kogi gentrify schlitz art party. Chartreuse salvia park williamsburg. Taxidermy tousled street cliche mumblecore you probably haven't heard of them godard selvage.\nNormcore blue bottle xoxo deep v. Sriracha stumptown sartorial. Blog sriracha 3 wolf moon humblebrag kale chips cardigan intelligentsia kickstarter.\nBanh mi portland put a bird on it brunch chia 8-bit etsy. Heirloom knausgaard lomo migas photo booth single-origin coffee. Cold-pressed waistcoat yr fingerstache readymade etsy. Bushwick sustainable portland cronut. Kinfolk cred tousled hashtag typewriter church-key flannel kickstarter.",
        "content_html": null,
        "replies": [],
        "created_at": "2017-11-22T13:42:13.937Z",
        "updated_at": "2017-11-22T13:42:13.937Z",
        "parent_id": 3,
        "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": 10,
        "author": {
          "id": 36,
          "login": "ppanaka",
          "url": "https://api.intra.42.fr/v2/users/ppanaka"
        },
        "content": "Single-origin coffee wolf vhs cliche williamsburg gentrify thundercats. Vhs whatever occupy fanny pack gastropub. Viral sriracha selvage mumblecore. Keffiyeh roof bushwick knausgaard vhs ramps loko.\nLomo single-origin coffee next level kitsch vice. Try-hard small batch migas godard kitsch williamsburg messenger bag. Chicharrones flexitarian roof deep v wayfarers butcher 8-bit. 90's pitchfork williamsburg.\nPinterest pour-over chicharrones pug vice. +1 gluten-free godard aesthetic vhs kinfolk. Mustache etsy flexitarian swag.",
        "content_html": null,
        "replies": [],
        "created_at": "2017-11-22T13:42:14.070Z",
        "updated_at": "2017-11-22T13:42:14.070Z",
        "parent_id": 3,
        "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-11-22T13:42:13.390Z",
    "updated_at": "2017-11-22T13:42:14.095Z",
    "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": 110,
      "login": "sebusebu",
      "url": "https://api.intra.42.fr/v2/users/sebusebu"
    },
    "content": "Five dollar toast freegan kickstarter. Blue bottle swag pitchfork cornhole schlitz. Fashion axe pbr&b austin. Ethical echo deep v. Fashion axe franzen twee organic vegan marfa authentic tilde.\nWayfarers direct trade tofu bespoke tilde portland plaid messenger bag. Jean shorts locavore tousled fanny pack freegan. Normcore gluten-free franzen plaid irony.\nSynth irony retro single-origin coffee squid meggings. Street trust fund disrupt iphone keffiyeh 90's lo-fi heirloom. Beard disrupt pitchfork. Craft beer vegan butcher keffiyeh mumblecore gentrify pickled tacos.",
    "content_html": null,
    "replies": [],
    "created_at": "2017-11-22T13:42:13.269Z",
    "updated_at": "2017-11-22T13:42:13.269Z",
    "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": 80,
      "login": "yyoda2",
      "url": "https://api.intra.42.fr/v2/users/yyoda2"
    },
    "content": "Hammock helvetica retro before they sold out kogi franzen taxidermy swag. Austin ramps goth actually wayfarers food truck pinterest. Knausgaard yolo chambray hashtag tacos whatever.\n90's fixie yolo typewriter schlitz drinking +1. Lo-fi tousled hashtag distillery mlkshk health kinfolk. Ugh brooklyn mustache actually health selfies post-ironic normcore. Shoreditch wes anderson gluten-free butcher whatever.\nNeutra waistcoat williamsburg put a bird on it cold-pressed yuccie keytar. Poutine offal schlitz tacos etsy pbr&b godard. Pickled forage kombucha schlitz truffaut dreamcatcher intelligentsia echo.",
    "content_html": null,
    "replies": [],
    "created_at": "2017-11-22T13:42:13.332Z",
    "updated_at": "2017-11-22T13:42:20.055Z",
    "parent_id": null,
    "is_root": false,
    "messageable_id": 1,
    "messageable_type": "Topic",
    "votes_count": {
      "upvote": 0,
      "downvote": 0,
      "trollvote": 1,
      "problem": 0
    },
    "user_votes": {
      "upvote": false,
      "downvote": false,
      "trollvote": false,
      "problem": false
    },
    "readings": 0
  },
  {
    "id": 3,
    "author": {
      "id": 87,
      "login": "wedantil",
      "url": "https://api.intra.42.fr/v2/users/wedantil"
    },
    "content": "Blog taxidermy tilde iphone sustainable. Yolo cold-pressed pinterest single-origin coffee brooklyn chicharrones knausgaard loko. Leggings gentrify venmo.\nVenmo wes anderson meggings mustache fashion axe. 8-bit meggings microdosing fixie kogi wayfarers. Everyday shabby chic shoreditch scenester plaid meggings pork belly 90's.\nIrony sustainable cardigan pour-over everyday marfa stumptown. Synth everyday pop-up +1 mumblecore readymade gastropub. Waistcoat literally cold-pressed. 3 wolf moon keytar swag hashtag. Cred lo-fi put a bird on it.",
    "content_html": null,
    "replies": [
      {
        "id": 8,
        "author": {
          "id": 98,
          "login": "okenobi",
          "url": "https://api.intra.42.fr/v2/users/okenobi"
        },
        "content": "Kogi gentrify schlitz art party. Chartreuse salvia park williamsburg. Taxidermy tousled street cliche mumblecore you probably haven't heard of them godard selvage.\nNormcore blue bottle xoxo deep v. Sriracha stumptown sartorial. Blog sriracha 3 wolf moon humblebrag kale chips cardigan intelligentsia kickstarter.\nBanh mi portland put a bird on it brunch chia 8-bit etsy. Heirloom knausgaard lomo migas photo booth single-origin coffee. Cold-pressed waistcoat yr fingerstache readymade etsy. Bushwick sustainable portland cronut. Kinfolk cred tousled hashtag typewriter church-key flannel kickstarter.",
        "content_html": null,
        "replies": [],
        "created_at": "2017-11-22T13:42:13.937Z",
        "updated_at": "2017-11-22T13:42:13.937Z",
        "parent_id": 3,
        "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": 10,
        "author": {
          "id": 36,
          "login": "ppanaka",
          "url": "https://api.intra.42.fr/v2/users/ppanaka"
        },
        "content": "Single-origin coffee wolf vhs cliche williamsburg gentrify thundercats. Vhs whatever occupy fanny pack gastropub. Viral sriracha selvage mumblecore. Keffiyeh roof bushwick knausgaard vhs ramps loko.\nLomo single-origin coffee next level kitsch vice. Try-hard small batch migas godard kitsch williamsburg messenger bag. Chicharrones flexitarian roof deep v wayfarers butcher 8-bit. 90's pitchfork williamsburg.\nPinterest pour-over chicharrones pug vice. +1 gluten-free godard aesthetic vhs kinfolk. Mustache etsy flexitarian swag.",
        "content_html": null,
        "replies": [],
        "created_at": "2017-11-22T13:42:14.070Z",
        "updated_at": "2017-11-22T13:42:14.070Z",
        "parent_id": 3,
        "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-11-22T13:42:13.390Z",
    "updated_at": "2017-11-22T13:42:14.095Z",
    "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"=>110, "login"=>"sebusebu", "url"=>"https://api.intra.42.fr/v2/users/sebusebu"}, "content"=>"Five dollar toast freegan kickstarter. Blue bottle swag pitchfork cornhole schlitz. Fashion axe pbr&b austin. Ethical echo deep v. Fashion axe franzen twee organic vegan marfa authentic tilde.\nWayfarers direct trade tofu bespoke tilde portland plaid messenger bag. Jean shorts locavore tousled fanny pack freegan. Normcore gluten-free franzen plaid irony.\nSynth irony retro single-origin coffee squid meggings. Street trust fund disrupt iphone keffiyeh 90's lo-fi heirloom. Beard disrupt pitchfork. Craft beer vegan butcher keffiyeh mumblecore gentrify pickled tacos.", "content_html"=>nil, "replies"=>[], "created_at"=>"2017-11-22T13:42:13.269Z", "updated_at"=>"2017-11-22T13:42:13.269Z", "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"=>80, "login"=>"yyoda2", "url"=>"https://api.intra.42.fr/v2/users/yyoda2"}, "content"=>"Hammock helvetica retro before they sold out kogi franzen taxidermy swag. Austin ramps goth actually wayfarers food truck pinterest. Knausgaard yolo chambray hashtag tacos whatever.\n90's fixie yolo typewriter schlitz drinking +1. Lo-fi tousled hashtag distillery mlkshk health kinfolk. Ugh brooklyn mustache actually health selfies post-ironic normcore. Shoreditch wes anderson gluten-free butcher whatever.\nNeutra waistcoat williamsburg put a bird on it cold-pressed yuccie keytar. Poutine offal schlitz tacos etsy pbr&b godard. Pickled forage kombucha schlitz truffaut dreamcatcher intelligentsia echo.", "content_html"=>nil, "replies"=>[], "created_at"=>"2017-11-22T13:42:13.332Z", "updated_at"=>"2017-11-22T13:42:20.055Z", "parent_id"=>nil, "is_root"=>false, "messageable_id"=>1, "messageable_type"=>"Topic", "votes_count"=>{"upvote"=>0, "downvote"=>0, "trollvote"=>1, "problem"=>0}, "user_votes"=>{"upvote"=>false, "downvote"=>false, "trollvote"=>false, "problem"=>false}, "readings"=>0}, {"id"=>3, "author"=>{"id"=>87, "login"=>"wedantil", "url"=>"https://api.intra.42.fr/v2/users/wedantil"}, "content"=>"Blog taxidermy tilde iphone sustainable. Yolo cold-pressed pinterest single-origin coffee brooklyn chicharrones knausgaard loko. Leggings gentrify venmo.\nVenmo wes anderson meggings mustache fashion axe. 8-bit meggings microdosing fixie kogi wayfarers. Everyday shabby chic shoreditch scenester plaid meggings pork belly 90's.\nIrony sustainable cardigan pour-over everyday marfa stumptown. Synth everyday pop-up +1 mumblecore readymade gastropub. Waistcoat literally cold-pressed. 3 wolf moon keytar swag hashtag. Cred lo-fi put a bird on it.", "content_html"=>nil, "replies"=>[{"id"=>8, "author"=>{"id"=>98, "login"=>"okenobi", "url"=>"https://api.intra.42.fr/v2/users/okenobi"}, "content"=>"Kogi gentrify schlitz art party. Chartreuse salvia park williamsburg. Taxidermy tousled street cliche mumblecore you probably haven't heard of them godard selvage.\nNormcore blue bottle xoxo deep v. Sriracha stumptown sartorial. Blog sriracha 3 wolf moon humblebrag kale chips cardigan intelligentsia kickstarter.\nBanh mi portland put a bird on it brunch chia 8-bit etsy. Heirloom knausgaard lomo migas photo booth single-origin coffee. Cold-pressed waistcoat yr fingerstache readymade etsy. Bushwick sustainable portland cronut. Kinfolk cred tousled hashtag typewriter church-key flannel kickstarter.", "content_html"=>nil, "replies"=>[], "created_at"=>"2017-11-22T13:42:13.937Z", "updated_at"=>"2017-11-22T13:42:13.937Z", "parent_id"=>3, "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"=>10, "author"=>{"id"=>36, "login"=>"ppanaka", "url"=>"https://api.intra.42.fr/v2/users/ppanaka"}, "content"=>"Single-origin coffee wolf vhs cliche williamsburg gentrify thundercats. Vhs whatever occupy fanny pack gastropub. Viral sriracha selvage mumblecore. Keffiyeh roof bushwick knausgaard vhs ramps loko.\nLomo single-origin coffee next level kitsch vice. Try-hard small batch migas godard kitsch williamsburg messenger bag. Chicharrones flexitarian roof deep v wayfarers butcher 8-bit. 90's pitchfork williamsburg.\nPinterest pour-over chicharrones pug vice. +1 gluten-free godard aesthetic vhs kinfolk. Mustache etsy flexitarian swag.", "content_html"=>nil, "replies"=>[], "created_at"=>"2017-11-22T13:42:14.070Z", "updated_at"=>"2017-11-22T13:42:14.070Z", "parent_id"=>3, "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-11-22T13:42:13.390Z", "updated_at"=>"2017-11-22T13:42:14.095Z", "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}]