live_help Notes

assignment This action requires one of theses roles: Basic staff

settings Params

Param name Description
id required . Must be String

The requested id

comments powered by <span class='logo-disqus'>Disqus</span>
GET /v2/rules/34
200
{
  "id": 34,
  "kind": "inscription",
  "name": "First name starting by",
  "description": "The user first name must start by the #{letter} letter",
  "created_at": "2016-05-31T15:00:49.898Z",
  "updated_at": "2016-05-31T15:00:49.898Z",
  "slug": "inscription-first-name-starting-by",
  "internal_name": "FirstNameStartingBy",
  "params": [
    {
      "id": 27,
      "name": "letter",
      "default_value": "",
      "rule_id": 34,
      "created_at": "2016-05-31T15:00:49.905Z",
      "updated_at": "2016-05-31T15:00:49.905Z",
      "data_type": "string"
    }
  ],
  "project_sessions_rules": []
}
GET /v2/rules/1
200
{
  "id": 1,
  "kind": "inscription",
  "name": "projects registered",
  "description": "register to %{projects}",
  "created_at": "2017-11-21T17:08:48.046Z",
  "updated_at": "2017-11-21T17:08:48.046Z",
  "slug": "inscription-projects-registered",
  "internal_name": "ProjectsRegistered",
  "params": []
}
curl  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" "https://api.intra.42.fr/v2/rules/34"

{
  "id": 34,
  "kind": "inscription",
  "name": "First name starting by",
  "description": "The user first name must start by the #{letter} letter",
  "created_at": "2016-05-31T15:00:49.898Z",
  "updated_at": "2016-05-31T15:00:49.898Z",
  "slug": "inscription-first-name-starting-by",
  "internal_name": "FirstNameStartingBy",
  "params": [
    {
      "id": 27,
      "name": "letter",
      "default_value": "",
      "rule_id": 34,
      "created_at": "2016-05-31T15:00:49.905Z",
      "updated_at": "2016-05-31T15:00:49.905Z",
      "data_type": "string"
    }
  ],
  "project_sessions_rules": []
}
curl  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" "https://api.intra.42.fr/v2/rules/1"

{
  "id": 1,
  "kind": "inscription",
  "name": "projects registered",
  "description": "register to %{projects}",
  "created_at": "2017-11-21T17:08:48.046Z",
  "updated_at": "2017-11-21T17:08:48.046Z",
  "slug": "inscription-projects-registered",
  "internal_name": "ProjectsRegistered",
  "params": []
}
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/rules/34")
response.status
# => 200
response.parsed
# => {"id"=>34, "kind"=>"inscription", "name"=>"First name starting by", "description"=>"The user first name must start by the \#{letter} letter", "created_at"=>"2016-05-31T15:00:49.898Z", "updated_at"=>"2016-05-31T15:00:49.898Z", "slug"=>"inscription-first-name-starting-by", "internal_name"=>"FirstNameStartingBy", "params"=>[{"id"=>27, "name"=>"letter", "default_value"=>"", "rule_id"=>34, "created_at"=>"2016-05-31T15:00:49.905Z", "updated_at"=>"2016-05-31T15:00:49.905Z", "data_type"=>"string"}], "project_sessions_rules"=>[]}
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/rules/1")
response.status
# => 200
response.parsed
# => {"id"=>1, "kind"=>"inscription", "name"=>"projects registered", "description"=>"register to %{projects}", "created_at"=>"2017-11-21T17:08:48.046Z", "updated_at"=>"2017-11-21T17:08:48.046Z", "slug"=>"inscription-projects-registered", "internal_name"=>"ProjectsRegistered", "params"=>[]}