live_help Notes

assignment This action requires one of theses roles: Student tutor, Advanced tutor, Advanced staff
group_work Requires following application scopes: projects

settings Params

Param name Description
partnership optional , nil allowed . Must be a Hash
partnership[name] required . Must be String

The name. Must be unique.

partnership[description] required . Must be String

The description.

partnership[difficulty] required . Must be Fixnum

The difficulty.

partnership[file] optional , nil allowed . Must be File

The file.

partnership[cursus_id] required . Must be Fixnum

The cursus id.

partnership[user_ids] optional , nil allowed . Must be an array of Integer

The user ids.

partnership[partnerships_skills_attributes] optional , nil allowed . Must be an Array of nested elements

The partnerships skills attributes.

partnership[partnerships_skills_attributes][id] optional , nil allowed . Must be Fixnum

The id.

partnership[partnerships_skills_attributes][skill_id] required . Must be Fixnum

The skill id.

partnership[partnerships_skills_attributes][value] required . Must be Float

The value.

partnership[partnerships_skills_attributes][_destroy] optional , nil allowed . Must be String

The destroy.

comments powered by <span class='logo-disqus'>Disqus</span>
POST /v2/partnerships
{
  "partnership": {
    "cursus_id": "2",
    "description": "The SQL system is down, generate the multi-byte capacitor so we can calculate the ADP port!",
    "difficulty": "100",
    "name": "The Orn",
    "partnerships_skills_attributes": [
      {
        "skill_id": "1",
        "value": "100.0"
      }
    ]
  }
}
201
{
  "id": 5,
  "name": "The Orn",
  "slug": "the-orn",
  "tier": 1,
  "url": "https://api.intra.42.fr/v2/partnerships/the-orn",
  "partnerships_users_url": "https://api.intra.42.fr/v2/partnerships/the-orn/partnerships_users"
}
curl  -X POST -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"partnership":{"cursus_id":"2","description":"The SQL system is down, generate the multi-byte capacitor so we can calculate the ADP port!","difficulty":"100","name":"The Orn","partnerships_skills_attributes":[{"skill_id":"1","value":"100.0"}]}}' "https://api.intra.42.fr/v2/partnerships"

{
  "id": 5,
  "name": "The Orn",
  "slug": "the-orn",
  "tier": 1,
  "url": "https://api.intra.42.fr/v2/partnerships/the-orn",
  "partnerships_users_url": "https://api.intra.42.fr/v2/partnerships/the-orn/partnerships_users"
}
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 = {partnership: {cursus_id: "2", description: "The SQL system is down, generate the multi-byte capacitor so we can calculate the ADP port!", difficulty: "100", name: "The Orn", partnerships_skills_attributes: [{skill_id: "1", value: "100.0"}]}}
response = token.post("/v2/partnerships", params: params)
response.status
# => 201
response.parsed
# => {"id"=>5, "name"=>"The Orn", "slug"=>"the-orn", "tier"=>1, "url"=>"https://api.intra.42.fr/v2/partnerships/the-orn", "partnerships_users_url"=>"https://api.intra.42.fr/v2/partnerships/the-orn/partnerships_users"}