live_help Notes

assignment This action requires one of theses roles: Advanced staff

settings Params

Param name Description
begin_at required . Must be String

begin_at must be before or equal to end_at, your date range must be 124 days maximum

end_at required . Must be String

end_at must be after or equal to begin_at, your date range must be 124 days maximum

POST /v2/campus/journal
{
  "begin_at": "2020-01-01",
  "end_at": "2020-04-01"
}
200
[
  {
    "event_at": "2020-01-02",
    "user_id": 69936,
    "cursus_id": 9,
    "reason": "Used intranet",
    "count": 1
  },
  {
    "event_at": "2020-01-02",
    "user_id": 69937,
    "cursus_id": 9,
    "reason": "Used intranet",
    "count": 1
  },
  {
    "event_at": "2020-01-03",
    "user_id": 69936,
    "cursus_id": 9,
    "reason": "Was evaluated by someone",
    "count": 1
  }
]
curl  -X POST -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"begin_at":"2020-01-01","end_at":"2020-04-01"}' "https://api.intra.42.fr/v2/campus/journal"

[
  {
    "event_at": "2020-01-02",
    "user_id": 69936,
    "cursus_id": 9,
    "reason": "Used intranet",
    "count": 1
  },
  {
    "event_at": "2020-01-02",
    "user_id": 69937,
    "cursus_id": 9,
    "reason": "Used intranet",
    "count": 1
  },
  {
    "event_at": "2020-01-03",
    "user_id": 69936,
    "cursus_id": 9,
    "reason": "Was evaluated by someone",
    "count": 1
  }
]
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

params = {begin_at: "2020-01-01", end_at: "2020-04-01"}
response = token.post("/v2/campus/journal", params: params)
response.status
# => 200
response.parsed
# => [{"event_at"=>"2020-01-02", "user_id"=>69936, "cursus_id"=>9, "reason"=>"Used intranet", "count"=>1}, {"event_at"=>"2020-01-02", "user_id"=>69937, "cursus_id"=>9, "reason"=>"Used intranet", "count"=>1}, {"event_at"=>"2020-01-03", "user_id"=>69936, "cursus_id"=>9, "reason"=>"Was evaluated by someone", "count"=>1}]