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": "indexing the hard drive won't do anything, we need to parse the solid state PNG application!",
    "difficulty": "100",
    "name": "Western Arkansas College",
    "partnerships_skills_attributes": [
      {
        "skill_id": "2",
        "value": "100.0"
      }
    ]
  }
}
201
{
  "id": 2,
  "name": "Western Arkansas College",
  "slug": "western-arkansas-college",
  "tier": 1,
  "url": "https://api.intra.42.fr/v2/partnerships/western-arkansas-college",
  "partnerships_users_url": "https://api.intra.42.fr/v2/partnerships/western-arkansas-college/partnerships_users"
}
curl  -X POST -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"partnership":{"cursus_id":"2","description":"indexing the hard drive won't do anything, we need to parse the solid state PNG application!","difficulty":"100","name":"Western Arkansas College","partnerships_skills_attributes":[{"skill_id":"2","value":"100.0"}]}}' "https://api.intra.42.fr/v2/partnerships"

{
  "id": 2,
  "name": "Western Arkansas College",
  "slug": "western-arkansas-college",
  "tier": 1,
  "url": "https://api.intra.42.fr/v2/partnerships/western-arkansas-college",
  "partnerships_users_url": "https://api.intra.42.fr/v2/partnerships/western-arkansas-college/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: "indexing the hard drive won't do anything, we need to parse the solid state PNG application!", difficulty: "100", name: "Western Arkansas College", partnerships_skills_attributes: [{skill_id: "2", value: "100.0"}]}}
response = token.post("/v2/partnerships", params: params)
response.status
# => 201
response.parsed
# => {"id"=>2, "name"=>"Western Arkansas College", "slug"=>"western-arkansas-college", "tier"=>1, "url"=>"https://api.intra.42.fr/v2/partnerships/western-arkansas-college", "partnerships_users_url"=>"https://api.intra.42.fr/v2/partnerships/western-arkansas-college/partnerships_users"}