live_help Notes

assignment This action requires one of theses roles: Advanced staff, Advanced tutor

settings Params

Param name Description
id required . Must be String

The requested id

GET /v2/mailings/42
200
{
  "id": 42,
  "subject": "Correction imminent",
  "created_at": "2016-04-28T12:30:10.116Z",
  "updated_at": "2016-04-28T12:30:10.116Z",
  "identifier": "imminent_correction_correctors",
  "meta": {
    "id": 268129,
    "date": "2016-04-28T14:45:00+02:00",
    "name": "Defense for ft_ls",
    "user": "Romain Baran",
    "other_user": "thifranc"
  },
  "title": "Correction imminent",
  "subtitle": null,
  "attachment": null,
  "from": "noreply@42.fr",
  "to": [
    "rbaran@student.42.fr"
  ],
  "cc": [],
  "bcc": [],
  "content": "Hi,\nYou will review thifranc's code in 15 minutes!",
  "html_content": "<p>Hi,\nYou will review thifranc&#39;s code in 15 minutes!</p>\n",
  "attachments": null
}
GET /v2/mailings/7
200
{
  "id": 7,
  "subject": "Judge me by my size, do you?",
  "created_at": "2017-11-22T13:42:11.054Z",
  "updated_at": "2017-11-22T13:42:11.054Z",
  "identifier": "spec-mail",
  "meta": {},
  "title": "I'll copy the wireless AGP pixel, that should interface the RSS application!",
  "subtitle": null,
  "attachment": null,
  "from": "kenton@schmeler.co",
  "to": [
    "bohutt2@student.42.fr"
  ],
  "cc": [],
  "bcc": [],
  "content": "Banh mi mixtape distillery gentrify post-ironic pour-over. Deep v fixie hella selfies irony direct trade paleo migas. Mumblecore kitsch hella selvage bicycle rights green juice. Keffiyeh salvia wolf vhs umami 90's. Cred lumbersexual chia hoodie pbr&b.\nSlow-carb sustainable cliche. Squid ennui kombucha yuccie biodiesel. Vhs cliche deep v mustache jean shorts trust fund fashion axe. Keffiyeh squid pbr&b fixie selvage.\nRoof blue bottle stumptown godard drinking yuccie. Craft beer artisan bushwick kale chips selvage. Kickstarter ethical asymmetrical franzen brooklyn etsy.",
  "html_content": "<p>Banh mi mixtape distillery gentrify post-ironic pour-over. Deep v fixie hella selfies irony direct trade paleo migas. Mumblecore kitsch hella selvage bicycle rights green juice. Keffiyeh salvia wolf vhs umami 90&#39;s. Cred lumbersexual chia hoodie pbr&amp;b.\nSlow-carb sustainable cliche. Squid ennui kombucha yuccie biodiesel. Vhs cliche deep v mustache jean shorts trust fund fashion axe. Keffiyeh squid pbr&amp;b fixie selvage.\nRoof blue bottle stumptown godard drinking yuccie. Craft beer artisan bushwick kale chips selvage. Kickstarter ethical asymmetrical franzen brooklyn etsy.</p>\n",
  "attachments": null
}
curl  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" "https://api.intra.42.fr/v2/mailings/42"

{
  "id": 42,
  "subject": "Correction imminent",
  "created_at": "2016-04-28T12:30:10.116Z",
  "updated_at": "2016-04-28T12:30:10.116Z",
  "identifier": "imminent_correction_correctors",
  "meta": {
    "id": 268129,
    "date": "2016-04-28T14:45:00+02:00",
    "name": "Defense for ft_ls",
    "user": "Romain Baran",
    "other_user": "thifranc"
  },
  "title": "Correction imminent",
  "subtitle": null,
  "attachment": null,
  "from": "noreply@42.fr",
  "to": [
    "rbaran@student.42.fr"
  ],
  "cc": [],
  "bcc": [],
  "content": "Hi,\nYou will review thifranc's code in 15 minutes!",
  "html_content": "<p>Hi,\nYou will review thifranc&#39;s code in 15 minutes!</p>\n",
  "attachments": null
}
curl  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" "https://api.intra.42.fr/v2/mailings/7"

{
  "id": 7,
  "subject": "Judge me by my size, do you?",
  "created_at": "2017-11-22T13:42:11.054Z",
  "updated_at": "2017-11-22T13:42:11.054Z",
  "identifier": "spec-mail",
  "meta": {},
  "title": "I'll copy the wireless AGP pixel, that should interface the RSS application!",
  "subtitle": null,
  "attachment": null,
  "from": "kenton@schmeler.co",
  "to": [
    "bohutt2@student.42.fr"
  ],
  "cc": [],
  "bcc": [],
  "content": "Banh mi mixtape distillery gentrify post-ironic pour-over. Deep v fixie hella selfies irony direct trade paleo migas. Mumblecore kitsch hella selvage bicycle rights green juice. Keffiyeh salvia wolf vhs umami 90's. Cred lumbersexual chia hoodie pbr&b.\nSlow-carb sustainable cliche. Squid ennui kombucha yuccie biodiesel. Vhs cliche deep v mustache jean shorts trust fund fashion axe. Keffiyeh squid pbr&b fixie selvage.\nRoof blue bottle stumptown godard drinking yuccie. Craft beer artisan bushwick kale chips selvage. Kickstarter ethical asymmetrical franzen brooklyn etsy.",
  "html_content": "<p>Banh mi mixtape distillery gentrify post-ironic pour-over. Deep v fixie hella selfies irony direct trade paleo migas. Mumblecore kitsch hella selvage bicycle rights green juice. Keffiyeh salvia wolf vhs umami 90&#39;s. Cred lumbersexual chia hoodie pbr&amp;b.\nSlow-carb sustainable cliche. Squid ennui kombucha yuccie biodiesel. Vhs cliche deep v mustache jean shorts trust fund fashion axe. Keffiyeh squid pbr&amp;b fixie selvage.\nRoof blue bottle stumptown godard drinking yuccie. Craft beer artisan bushwick kale chips selvage. Kickstarter ethical asymmetrical franzen brooklyn etsy.</p>\n",
  "attachments": null
}
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/mailings/42")
response.status
# => 200
response.parsed
# => {"id"=>42, "subject"=>"Correction imminent", "created_at"=>"2016-04-28T12:30:10.116Z", "updated_at"=>"2016-04-28T12:30:10.116Z", "identifier"=>"imminent_correction_correctors", "meta"=>{"id"=>268129, "date"=>"2016-04-28T14:45:00+02:00", "name"=>"Defense for ft_ls", "user"=>"Romain Baran", "other_user"=>"thifranc"}, "title"=>"Correction imminent", "subtitle"=>nil, "attachment"=>nil, "from"=>"noreply@42.fr", "to"=>["rbaran@student.42.fr"], "cc"=>[], "bcc"=>[], "content"=>"Hi,\nYou will review thifranc's code in 15 minutes!", "html_content"=>"<p>Hi,\nYou will review thifranc&#39;s code in 15 minutes!</p>\n", "attachments"=>nil}
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/mailings/7")
response.status
# => 200
response.parsed
# => {"id"=>7, "subject"=>"Judge me by my size, do you?", "created_at"=>"2017-11-22T13:42:11.054Z", "updated_at"=>"2017-11-22T13:42:11.054Z", "identifier"=>"spec-mail", "meta"=>{}, "title"=>"I'll copy the wireless AGP pixel, that should interface the RSS application!", "subtitle"=>nil, "attachment"=>nil, "from"=>"kenton@schmeler.co", "to"=>["bohutt2@student.42.fr"], "cc"=>[], "bcc"=>[], "content"=>"Banh mi mixtape distillery gentrify post-ironic pour-over. Deep v fixie hella selfies irony direct trade paleo migas. Mumblecore kitsch hella selvage bicycle rights green juice. Keffiyeh salvia wolf vhs umami 90's. Cred lumbersexual chia hoodie pbr&b.\nSlow-carb sustainable cliche. Squid ennui kombucha yuccie biodiesel. Vhs cliche deep v mustache jean shorts trust fund fashion axe. Keffiyeh squid pbr&b fixie selvage.\nRoof blue bottle stumptown godard drinking yuccie. Craft beer artisan bushwick kale chips selvage. Kickstarter ethical asymmetrical franzen brooklyn etsy.", "html_content"=>"<p>Banh mi mixtape distillery gentrify post-ironic pour-over. Deep v fixie hella selfies irony direct trade paleo migas. Mumblecore kitsch hella selvage bicycle rights green juice. Keffiyeh salvia wolf vhs umami 90&#39;s. Cred lumbersexual chia hoodie pbr&amp;b.\nSlow-carb sustainable cliche. Squid ennui kombucha yuccie biodiesel. Vhs cliche deep v mustache jean shorts trust fund fashion axe. Keffiyeh squid pbr&amp;b fixie selvage.\nRoof blue bottle stumptown godard drinking yuccie. Craft beer artisan bushwick kale chips selvage. Kickstarter ethical asymmetrical franzen brooklyn etsy.</p>\n", "attachments"=>nil}