GET /v2/rules/:id
Get a rule
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 |
Examples
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/6
200
{
"id": 6,
"kind": "inscription",
"name": "Skill level min",
"description": "be at least level %{level} at %{skill} in cursus %{cursus}",
"created_at": "2017-11-22T13:41:01.907Z",
"updated_at": "2017-11-22T13:41:01.907Z",
"slug": "inscription-skill-level-min",
"internal_name": "SkillLevelMin",
"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/6"
{
"id": 6,
"kind": "inscription",
"name": "Skill level min",
"description": "be at least level %{level} at %{skill} in cursus %{cursus}",
"created_at": "2017-11-22T13:41:01.907Z",
"updated_at": "2017-11-22T13:41:01.907Z",
"slug": "inscription-skill-level-min",
"internal_name": "SkillLevelMin",
"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/6")
response.status
# => 200
response.parsed
# => {"id"=>6, "kind"=>"inscription", "name"=>"Skill level min", "description"=>"be at least level %{level} at %{skill} in cursus %{cursus}", "created_at"=>"2017-11-22T13:41:01.907Z", "updated_at"=>"2017-11-22T13:41:01.907Z", "slug"=>"inscription-skill-level-min", "internal_name"=>"SkillLevelMin", "params"=>[]}