using Meitner;
using Meitner.Models.Components;
using System;
var sdk = new MeitnerSDK(security: new Security() {
Option1 = new SecurityOption1() {
ClientCredentials = "<YOUR_API_KEY_HERE>",
ClientSecret = "<YOUR_API_KEY_HERE>",
},
});
var res = await sdk.StudentPlacements.UpdateAsync(
id: "123e4567-e89b-12d3-a456-426614174000",
studentPlacementUpdate: new StudentPlacementUpdate() {
External = new StudentPlacementUpdateExternal() {
SourceID = "12345678",
},
SchoolType = StudentPlacementUpdateSchoolType.Gr,
SchoolYear = StudentPlacementUpdateSchoolYear.One,
HasChildcare = true,
ChildcareMaxHours = 15,
MotherTongue = "SWE",
ModernLanguageAlternative = StudentPlacementUpdateModernLanguageAlternative.En,
ModernLanguageInSchoolChoice = "deu",
ModernLanguageInLanguageChoice = "fra",
StartDate = DateOnly.Parse("2024-08-01"),
EndDate = DateOnly.Parse("2025-08-01"),
}
);
// handle responsefrom datetime import date
from meitner import Meitner, models
import os
with Meitner(
security=models.Security(
option1=models.SecurityOption1(
client_credentials=os.getenv("MEITNER_CLIENT_CREDENTIALS", ""),
client_secret=os.getenv("MEITNER_CLIENT_SECRET", ""),
),
),
) as m_client:
res = m_client.student_placements.update(id="123e4567-e89b-12d3-a456-426614174000", school_type="GR", start_date=date.fromisoformat("2024-08-01"), external={
"source_id": "12345678",
}, school_year="1", has_childcare=True, childcare_max_hours=15, mother_tongue="SWE", modern_language_alternative="EN", swedish_as_second_language=False, mother_tongue_participates=False, modern_language_in_school_choice="deu", modern_language_in_language_choice="fra", end_date=date.fromisoformat("2025-08-01"))
# Handle response
print(res)curl --request PATCH \
--url https://api.meitner.se/directory/v1/student-placement/{id} \
--header 'Client-ID: <api-key>' \
--header 'Client-Secret: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"external": {
"sourceID": "12345678"
},
"schoolType": "GR",
"schoolYear": "1",
"hasChildcare": true,
"childcareMaxHours": 15,
"motherTongue": "SWE",
"modernLanguageAlternative": "EN",
"swedishAsSecondLanguage": false,
"motherTongueParticipates": false,
"modernLanguageInSchoolChoice": "deu",
"modernLanguageInLanguageChoice": "fra",
"startDate": "2024-08-01",
"endDate": "2025-08-01"
}
'const options = {
method: 'PATCH',
headers: {
'Client-ID': '<api-key>',
'Client-Secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
external: {sourceID: '12345678'},
schoolType: 'GR',
schoolYear: '1',
hasChildcare: true,
childcareMaxHours: 15,
motherTongue: 'SWE',
modernLanguageAlternative: 'EN',
swedishAsSecondLanguage: false,
motherTongueParticipates: false,
modernLanguageInSchoolChoice: 'deu',
modernLanguageInLanguageChoice: 'fra',
startDate: '2024-08-01',
endDate: '2025-08-01'
})
};
fetch('https://api.meitner.se/directory/v1/student-placement/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.meitner.se/directory/v1/student-placement/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'external' => [
'sourceID' => '12345678'
],
'schoolType' => 'GR',
'schoolYear' => '1',
'hasChildcare' => true,
'childcareMaxHours' => 15,
'motherTongue' => 'SWE',
'modernLanguageAlternative' => 'EN',
'swedishAsSecondLanguage' => false,
'motherTongueParticipates' => false,
'modernLanguageInSchoolChoice' => 'deu',
'modernLanguageInLanguageChoice' => 'fra',
'startDate' => '2024-08-01',
'endDate' => '2025-08-01'
]),
CURLOPT_HTTPHEADER => [
"Client-ID: <api-key>",
"Client-Secret: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.meitner.se/directory/v1/student-placement/{id}"
payload := strings.NewReader("{\n \"external\": {\n \"sourceID\": \"12345678\"\n },\n \"schoolType\": \"GR\",\n \"schoolYear\": \"1\",\n \"hasChildcare\": true,\n \"childcareMaxHours\": 15,\n \"motherTongue\": \"SWE\",\n \"modernLanguageAlternative\": \"EN\",\n \"swedishAsSecondLanguage\": false,\n \"motherTongueParticipates\": false,\n \"modernLanguageInSchoolChoice\": \"deu\",\n \"modernLanguageInLanguageChoice\": \"fra\",\n \"startDate\": \"2024-08-01\",\n \"endDate\": \"2025-08-01\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Client-ID", "<api-key>")
req.Header.Add("Client-Secret", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.meitner.se/directory/v1/student-placement/{id}")
.header("Client-ID", "<api-key>")
.header("Client-Secret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"external\": {\n \"sourceID\": \"12345678\"\n },\n \"schoolType\": \"GR\",\n \"schoolYear\": \"1\",\n \"hasChildcare\": true,\n \"childcareMaxHours\": 15,\n \"motherTongue\": \"SWE\",\n \"modernLanguageAlternative\": \"EN\",\n \"swedishAsSecondLanguage\": false,\n \"motherTongueParticipates\": false,\n \"modernLanguageInSchoolChoice\": \"deu\",\n \"modernLanguageInLanguageChoice\": \"fra\",\n \"startDate\": \"2024-08-01\",\n \"endDate\": \"2025-08-01\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meitner.se/directory/v1/student-placement/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Client-ID"] = '<api-key>'
request["Client-Secret"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"external\": {\n \"sourceID\": \"12345678\"\n },\n \"schoolType\": \"GR\",\n \"schoolYear\": \"1\",\n \"hasChildcare\": true,\n \"childcareMaxHours\": 15,\n \"motherTongue\": \"SWE\",\n \"modernLanguageAlternative\": \"EN\",\n \"swedishAsSecondLanguage\": false,\n \"motherTongueParticipates\": false,\n \"modernLanguageInSchoolChoice\": \"deu\",\n \"modernLanguageInLanguageChoice\": \"fra\",\n \"startDate\": \"2024-08-01\",\n \"endDate\": \"2025-08-01\"\n}"
response = http.request(request)
puts response.read_body{
"id": "123e4567-e89b-12d3-a456-426614174000",
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"createdBy": "987fcdeb-51a2-43d1-b567-123456789abc",
"updatedAt": "2024-01-15T14:45:00Z",
"updatedBy": "987fcdeb-51a2-43d1-b567-123456789abc"
},
"external": {
"sourceID": "12345678",
"source": "ExternalIntegrationAPI"
},
"studentID": "123e4567-e89b-12d3-a456-426614174000",
"schoolID": "123e4567-e89b-12d3-a456-426614174000",
"schoolType": "GR",
"schoolYear": "1",
"hasChildcare": true,
"childcareMaxHours": 15,
"motherTongue": "SWE",
"modernLanguageAlternative": "EN",
"swedishAsSecondLanguage": false,
"motherTongueParticipates": false,
"modernLanguageInSchoolChoice": "deu",
"modernLanguageInLanguageChoice": "fra",
"startDate": "2024-08-01",
"endDate": "2025-08-01",
"archiveYear": "2024_2025",
"archivedAt": "2024-08-01T00:00:00Z"
}{
"error": {
"code": "BadRequest",
"message": "The request contains invalid parameters or malformed data",
"requestID": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "Unauthorized",
"message": "Authentication credentials are missing or invalid",
"requestID": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "Forbidden",
"message": "You do not have permission to perform this operation",
"requestID": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "NotFound",
"message": "The requested resource could not be found",
"requestID": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "Conflict",
"message": "The request conflicts with the current state of the resource",
"requestID": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "UnprocessableEntity",
"message": "Validation failed for StudentPlacement Update endpoint",
"requestID": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "RateLimited",
"message": "Too many requests - rate limit exceeded",
"requestID": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "Internal",
"message": "An unexpected server error occurred",
"requestID": "550e8400-e29b-41d4-a716-446655440000"
}
}Update a StudentPlacement
Update a StudentPlacement
using Meitner;
using Meitner.Models.Components;
using System;
var sdk = new MeitnerSDK(security: new Security() {
Option1 = new SecurityOption1() {
ClientCredentials = "<YOUR_API_KEY_HERE>",
ClientSecret = "<YOUR_API_KEY_HERE>",
},
});
var res = await sdk.StudentPlacements.UpdateAsync(
id: "123e4567-e89b-12d3-a456-426614174000",
studentPlacementUpdate: new StudentPlacementUpdate() {
External = new StudentPlacementUpdateExternal() {
SourceID = "12345678",
},
SchoolType = StudentPlacementUpdateSchoolType.Gr,
SchoolYear = StudentPlacementUpdateSchoolYear.One,
HasChildcare = true,
ChildcareMaxHours = 15,
MotherTongue = "SWE",
ModernLanguageAlternative = StudentPlacementUpdateModernLanguageAlternative.En,
ModernLanguageInSchoolChoice = "deu",
ModernLanguageInLanguageChoice = "fra",
StartDate = DateOnly.Parse("2024-08-01"),
EndDate = DateOnly.Parse("2025-08-01"),
}
);
// handle responsefrom datetime import date
from meitner import Meitner, models
import os
with Meitner(
security=models.Security(
option1=models.SecurityOption1(
client_credentials=os.getenv("MEITNER_CLIENT_CREDENTIALS", ""),
client_secret=os.getenv("MEITNER_CLIENT_SECRET", ""),
),
),
) as m_client:
res = m_client.student_placements.update(id="123e4567-e89b-12d3-a456-426614174000", school_type="GR", start_date=date.fromisoformat("2024-08-01"), external={
"source_id": "12345678",
}, school_year="1", has_childcare=True, childcare_max_hours=15, mother_tongue="SWE", modern_language_alternative="EN", swedish_as_second_language=False, mother_tongue_participates=False, modern_language_in_school_choice="deu", modern_language_in_language_choice="fra", end_date=date.fromisoformat("2025-08-01"))
# Handle response
print(res)curl --request PATCH \
--url https://api.meitner.se/directory/v1/student-placement/{id} \
--header 'Client-ID: <api-key>' \
--header 'Client-Secret: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"external": {
"sourceID": "12345678"
},
"schoolType": "GR",
"schoolYear": "1",
"hasChildcare": true,
"childcareMaxHours": 15,
"motherTongue": "SWE",
"modernLanguageAlternative": "EN",
"swedishAsSecondLanguage": false,
"motherTongueParticipates": false,
"modernLanguageInSchoolChoice": "deu",
"modernLanguageInLanguageChoice": "fra",
"startDate": "2024-08-01",
"endDate": "2025-08-01"
}
'const options = {
method: 'PATCH',
headers: {
'Client-ID': '<api-key>',
'Client-Secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
external: {sourceID: '12345678'},
schoolType: 'GR',
schoolYear: '1',
hasChildcare: true,
childcareMaxHours: 15,
motherTongue: 'SWE',
modernLanguageAlternative: 'EN',
swedishAsSecondLanguage: false,
motherTongueParticipates: false,
modernLanguageInSchoolChoice: 'deu',
modernLanguageInLanguageChoice: 'fra',
startDate: '2024-08-01',
endDate: '2025-08-01'
})
};
fetch('https://api.meitner.se/directory/v1/student-placement/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.meitner.se/directory/v1/student-placement/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'external' => [
'sourceID' => '12345678'
],
'schoolType' => 'GR',
'schoolYear' => '1',
'hasChildcare' => true,
'childcareMaxHours' => 15,
'motherTongue' => 'SWE',
'modernLanguageAlternative' => 'EN',
'swedishAsSecondLanguage' => false,
'motherTongueParticipates' => false,
'modernLanguageInSchoolChoice' => 'deu',
'modernLanguageInLanguageChoice' => 'fra',
'startDate' => '2024-08-01',
'endDate' => '2025-08-01'
]),
CURLOPT_HTTPHEADER => [
"Client-ID: <api-key>",
"Client-Secret: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.meitner.se/directory/v1/student-placement/{id}"
payload := strings.NewReader("{\n \"external\": {\n \"sourceID\": \"12345678\"\n },\n \"schoolType\": \"GR\",\n \"schoolYear\": \"1\",\n \"hasChildcare\": true,\n \"childcareMaxHours\": 15,\n \"motherTongue\": \"SWE\",\n \"modernLanguageAlternative\": \"EN\",\n \"swedishAsSecondLanguage\": false,\n \"motherTongueParticipates\": false,\n \"modernLanguageInSchoolChoice\": \"deu\",\n \"modernLanguageInLanguageChoice\": \"fra\",\n \"startDate\": \"2024-08-01\",\n \"endDate\": \"2025-08-01\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Client-ID", "<api-key>")
req.Header.Add("Client-Secret", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.meitner.se/directory/v1/student-placement/{id}")
.header("Client-ID", "<api-key>")
.header("Client-Secret", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"external\": {\n \"sourceID\": \"12345678\"\n },\n \"schoolType\": \"GR\",\n \"schoolYear\": \"1\",\n \"hasChildcare\": true,\n \"childcareMaxHours\": 15,\n \"motherTongue\": \"SWE\",\n \"modernLanguageAlternative\": \"EN\",\n \"swedishAsSecondLanguage\": false,\n \"motherTongueParticipates\": false,\n \"modernLanguageInSchoolChoice\": \"deu\",\n \"modernLanguageInLanguageChoice\": \"fra\",\n \"startDate\": \"2024-08-01\",\n \"endDate\": \"2025-08-01\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meitner.se/directory/v1/student-placement/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Client-ID"] = '<api-key>'
request["Client-Secret"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"external\": {\n \"sourceID\": \"12345678\"\n },\n \"schoolType\": \"GR\",\n \"schoolYear\": \"1\",\n \"hasChildcare\": true,\n \"childcareMaxHours\": 15,\n \"motherTongue\": \"SWE\",\n \"modernLanguageAlternative\": \"EN\",\n \"swedishAsSecondLanguage\": false,\n \"motherTongueParticipates\": false,\n \"modernLanguageInSchoolChoice\": \"deu\",\n \"modernLanguageInLanguageChoice\": \"fra\",\n \"startDate\": \"2024-08-01\",\n \"endDate\": \"2025-08-01\"\n}"
response = http.request(request)
puts response.read_body{
"id": "123e4567-e89b-12d3-a456-426614174000",
"meta": {
"createdAt": "2024-01-15T10:30:00Z",
"createdBy": "987fcdeb-51a2-43d1-b567-123456789abc",
"updatedAt": "2024-01-15T14:45:00Z",
"updatedBy": "987fcdeb-51a2-43d1-b567-123456789abc"
},
"external": {
"sourceID": "12345678",
"source": "ExternalIntegrationAPI"
},
"studentID": "123e4567-e89b-12d3-a456-426614174000",
"schoolID": "123e4567-e89b-12d3-a456-426614174000",
"schoolType": "GR",
"schoolYear": "1",
"hasChildcare": true,
"childcareMaxHours": 15,
"motherTongue": "SWE",
"modernLanguageAlternative": "EN",
"swedishAsSecondLanguage": false,
"motherTongueParticipates": false,
"modernLanguageInSchoolChoice": "deu",
"modernLanguageInLanguageChoice": "fra",
"startDate": "2024-08-01",
"endDate": "2025-08-01",
"archiveYear": "2024_2025",
"archivedAt": "2024-08-01T00:00:00Z"
}{
"error": {
"code": "BadRequest",
"message": "The request contains invalid parameters or malformed data",
"requestID": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "Unauthorized",
"message": "Authentication credentials are missing or invalid",
"requestID": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "Forbidden",
"message": "You do not have permission to perform this operation",
"requestID": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "NotFound",
"message": "The requested resource could not be found",
"requestID": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "Conflict",
"message": "The request conflicts with the current state of the resource",
"requestID": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "UnprocessableEntity",
"message": "Validation failed for StudentPlacement Update endpoint",
"requestID": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "RateLimited",
"message": "Too many requests - rate limit exceeded",
"requestID": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "Internal",
"message": "An unexpected server error occurred",
"requestID": "550e8400-e29b-41d4-a716-446655440000"
}
}Authorizations
Path Parameters
The unique identifier of the StudentPlacement to update
"123e4567-e89b-12d3-a456-426614174000"
Body
Request body
The school type for the student, if not provided on Create, the school type will be fetched from the school.
GR, GRAN, GY, GYAN, FS, VUX, VUXSFI "GR"
The start date of the placement
"2024-08-01"
ExternalRequest is the External-object used on Update and Create operations, since it should only be allowed to set SourceID for the student placement, the Source-field is not included.
Show child attributes
Show child attributes
{ "sourceID": "12345678" }
The school year the student is placed in
0, 1, 2, 3, 4, 5, 6, 7, 8, 9 "1"
Whether the student has childcare
true
The maximum number of childcare hours per week for the student at this school
15
null
The mother tongue of the student. Language codes follow the ISO 639-3 standard (three-letter codes).
"SWE"
null
The modern language alternative for the student
EN, ML, SV, SVA, TN "EN"
Whether the student has Swedish as their second language
false
Whether the student participates in mother tongue education
false
The language code for the student's modern language in school choice (Skolans val). Language codes follow the ISO 639-2 standard (three-letter codes).
"deu"
null
The language code for the student's modern language in language choice (Språkval, M2, B-språk). Language codes follow the ISO 639-2 standard (three-letter codes).
"fra"
null
The end date of the placement
"2025-08-01"
null
Response
Response for StudentPlacement Update operation - returns the updated StudentPlacement
StudentPlacement holds the placement information about a student in a specific school.
Unique identifier for the StudentPlacement
"123e4567-e89b-12d3-a456-426614174000"
The ID of the student the placement belongs to
"123e4567-e89b-12d3-a456-426614174000"
The ID of the school the student is placed in
"123e4567-e89b-12d3-a456-426614174000"
The school type for the student, if not provided on Create, the school type will be fetched from the school.
GR, GRAN, GY, GYAN, FS, VUX, VUXSFI "GR"
The start date of the placement
"2024-08-01"
Metadata information for the StudentPlacement
Show child attributes
Show child attributes
{
"createdAt": "2024-01-15T10:30:00Z",
"createdBy": "987fcdeb-51a2-43d1-b567-123456789abc",
"updatedAt": "2024-01-15T14:45:00Z",
"updatedBy": "987fcdeb-51a2-43d1-b567-123456789abc"
}
External is a reusable object that can be used to store external information about the student placement from another system, used for third-party integration tracking.
Show child attributes
Show child attributes
{
"sourceID": "12345678",
"source": "ExternalIntegrationAPI"
}
The school year the student is placed in
0, 1, 2, 3, 4, 5, 6, 7, 8, 9 "1"
Whether the student has childcare
true
The maximum number of childcare hours per week for the student at this school
15
null
The mother tongue of the student. Language codes follow the ISO 639-3 standard (three-letter codes).
"SWE"
null
The modern language alternative for the student
EN, ML, SV, SVA, TN "EN"
Whether the student has Swedish as their second language
false
Whether the student participates in mother tongue education
false
The language code for the student's modern language in school choice (Skolans val). Language codes follow the ISO 639-2 standard (three-letter codes).
"deu"
null
The language code for the student's modern language in language choice (Språkval, M2, B-språk). Language codes follow the ISO 639-2 standard (three-letter codes).
"fra"
null
The end date of the placement
"2025-08-01"
null
The year the placement was archived for the student, in the format YYYY_YYYY where the first year is the autumn and the second year is the spring.
"2024_2025"
null
The timestamp the placement was archived for the student
"2024-08-01T00:00:00Z"
null