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

comments powered by <span class='logo-disqus'>Disqus</span>
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/10
200
{
  "id": 10,
  "subject": "You know, that little droid is going to cause me a lot of trouble.",
  "created_at": "2017-03-06T14:59:36.464Z",
  "updated_at": "2017-03-06T14:59:36.464Z",
  "identifier": "spec-mail",
  "meta": {},
  "title": "Try to back up the SCSI circuit, maybe it will hack the neural interface!",
  "subtitle": null,
  "attachment": null,
  "from": "scot_orn@legros.net",
  "to": [
    "chechewb@student.42.fr"
  ],
  "cc": [],
  "bcc": [],
  "content": "Stumptown viral polaroid craft beer banjo art party diy listicle. Tumblr actually you probably haven't heard of them paleo vice flexitarian. Diy tilde distillery raw denim vhs master marfa cronut.\nTry-hard selfies yolo sriracha. Kitsch helvetica asymmetrical fap fixie tacos slow-carb. Banh mi etsy gastropub.\nShabby chic polaroid meditation. Tofu kinfolk fixie yolo five dollar toast. Pabst kitsch marfa yolo health.",
  "html_content": "<p>Stumptown viral polaroid craft beer banjo art party diy listicle. Tumblr actually you probably haven&#39;t heard of them paleo vice flexitarian. Diy tilde distillery raw denim vhs master marfa cronut.\nTry-hard selfies yolo sriracha. Kitsch helvetica asymmetrical fap fixie tacos slow-carb. Banh mi etsy gastropub.\nShabby chic polaroid meditation. Tofu kinfolk fixie yolo five dollar toast. Pabst kitsch marfa yolo health.</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/10"

{
  "id": 10,
  "subject": "You know, that little droid is going to cause me a lot of trouble.",
  "created_at": "2017-03-06T14:59:36.464Z",
  "updated_at": "2017-03-06T14:59:36.464Z",
  "identifier": "spec-mail",
  "meta": {},
  "title": "Try to back up the SCSI circuit, maybe it will hack the neural interface!",
  "subtitle": null,
  "attachment": null,
  "from": "scot_orn@legros.net",
  "to": [
    "chechewb@student.42.fr"
  ],
  "cc": [],
  "bcc": [],
  "content": "Stumptown viral polaroid craft beer banjo art party diy listicle. Tumblr actually you probably haven't heard of them paleo vice flexitarian. Diy tilde distillery raw denim vhs master marfa cronut.\nTry-hard selfies yolo sriracha. Kitsch helvetica asymmetrical fap fixie tacos slow-carb. Banh mi etsy gastropub.\nShabby chic polaroid meditation. Tofu kinfolk fixie yolo five dollar toast. Pabst kitsch marfa yolo health.",
  "html_content": "<p>Stumptown viral polaroid craft beer banjo art party diy listicle. Tumblr actually you probably haven&#39;t heard of them paleo vice flexitarian. Diy tilde distillery raw denim vhs master marfa cronut.\nTry-hard selfies yolo sriracha. Kitsch helvetica asymmetrical fap fixie tacos slow-carb. Banh mi etsy gastropub.\nShabby chic polaroid meditation. Tofu kinfolk fixie yolo five dollar toast. Pabst kitsch marfa yolo health.</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/10")
response.status
# => 200
response.parsed
# => {"id"=>10, "subject"=>"You know, that little droid is going to cause me a lot of trouble.", "created_at"=>"2017-03-06T14:59:36.464Z", "updated_at"=>"2017-03-06T14:59:36.464Z", "identifier"=>"spec-mail", "meta"=>{}, "title"=>"Try to back up the SCSI circuit, maybe it will hack the neural interface!", "subtitle"=>nil, "attachment"=>nil, "from"=>"scot_orn@legros.net", "to"=>["chechewb@student.42.fr"], "cc"=>[], "bcc"=>[], "content"=>"Stumptown viral polaroid craft beer banjo art party diy listicle. Tumblr actually you probably haven't heard of them paleo vice flexitarian. Diy tilde distillery raw denim vhs master marfa cronut.\nTry-hard selfies yolo sriracha. Kitsch helvetica asymmetrical fap fixie tacos slow-carb. Banh mi etsy gastropub.\nShabby chic polaroid meditation. Tofu kinfolk fixie yolo five dollar toast. Pabst kitsch marfa yolo health.", "html_content"=>"<p>Stumptown viral polaroid craft beer banjo art party diy listicle. Tumblr actually you probably haven&#39;t heard of them paleo vice flexitarian. Diy tilde distillery raw denim vhs master marfa cronut.\nTry-hard selfies yolo sriracha. Kitsch helvetica asymmetrical fap fixie tacos slow-carb. Banh mi etsy gastropub.\nShabby chic polaroid meditation. Tofu kinfolk fixie yolo five dollar toast. Pabst kitsch marfa yolo health.</p>\n", "attachments"=>nil}