POST /v2/pools/:id/points/add
Add points in specific pool. If number of points are bigger than max points, balance will be triggered. You are allowed to modify ONLY for your campus.
live_help Notes
assignment
This action requires one of theses roles:
Advanced tutor
settings Params
Param name | Description |
---|---|
id |
required
. Must be String
The requested id |
points |
required
. Must be a number.
Number of points to be added. Points can be negative. |
Examples
POST /v2/pools/1/points/add
{
"points": 10
}
{
"id": 25,
"current_points": 1310,
"max_points": 1400,
"cursus_id": 1,
"campus_id": 1
}
curl -X POST -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json" -d '{"points":10}' "https://api.intra.42.fr/v2/pools/1/points/add"
{
"id": 25,
"current_points": 1310,
"max_points": 1400,
"cursus_id": 1,
"campus_id": 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 = {points: 10}
response = token.post("/v2/pools/1/points/add", params: params)
response.status
# =>
response.parsed
# => {"id"=>25, "current_points"=>1310, "max_points"=>1400, "cursus_id"=>1, "campus_id"=>1}