> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://apidoc.dreamclass.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://apidoc.dreamclass.io/_mcp/server.

# Student Period

POST https://#post2
Content-Type: application/json

Webhook related to student assigned to a period, trigged upon

- Student period created: STUDENT_PERIOD_CREATED
    
- Student period updated: STUDENT_PERIOD_UPDATED
    
- Student period deleted: STUDENT_PERIOD_DELETED
    

Using the provided studentId, use the GetStudent API to retrieve more data. The provided id can be matched with the results of GetPeriodStudents

Reference: https://apidoc.dreamclass.io/dream-class-api/webhooks/student-period

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /#post2:
    post:
      operationId: student-period
      summary: Student Period
      description: >-
        Webhook related to student assigned to a period, trigged upon


        - Student period created: STUDENT_PERIOD_CREATED
            
        - Student period updated: STUDENT_PERIOD_UPDATED
            
        - Student period deleted: STUDENT_PERIOD_DELETED
            

        Using the provided studentId, use the GetStudent API to retrieve more
        data. The provided id can be matched with the results of
        GetPeriodStudents
      tags:
        - subpackage_webhooks
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Webhooks_Student Period_Response_200'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: string
                  format: uuid
                data:
                  $ref: >-
                    #/components/schemas/Post2PostRequestBodyContentApplicationJsonSchemaData
                type:
                  type: string
                tenant:
                  type: string
                signature:
                  type: string
                timestamp:
                  type: integer
              required:
                - id
                - data
                - type
                - tenant
                - signature
                - timestamp
servers:
  - url: https:/
    description: https://{server}
  - url: https://your-webhook-url
    description: https://your-webhook-url
components:
  schemas:
    Post2PostRequestBodyContentApplicationJsonSchemaData:
      type: object
      properties:
        id:
          type: integer
        active:
          type: boolean
        addedAt:
          type: string
          format: date-time
        studentId:
          type: integer
      required:
        - id
        - active
        - addedAt
        - studentId
      title: Post2PostRequestBodyContentApplicationJsonSchemaData
    Webhooks_Student Period_Response_200:
      type: object
      properties: {}
      description: Empty response body
      title: Webhooks_Student Period_Response_200

```

## Examples



**Request**

```json
{
  "id": "b3e6fa78-8672-4e8b-8431-7eebdabd25a2",
  "data": {
    "id": 74,
    "active": true,
    "addedAt": "2024-10-02T09:40:02.179+00:00",
    "studentId": 76
  },
  "type": "STUDENT_PERIOD_CREATED",
  "tenant": "my-school",
  "signature": "nGq8sspzZVWObaR4zUOLyQ29m/IBxxD716hKx5298No=",
  "timestamp": 1727862002901
}
```

**Response**

```json
{}
```

**SDK Code**

```python
import requests

url = "https://https/#post2"

payload = {
    "id": "b3e6fa78-8672-4e8b-8431-7eebdabd25a2",
    "data": {
        "id": 74,
        "active": True,
        "addedAt": "2024-10-02T09:40:02.179+00:00",
        "studentId": 76
    },
    "type": "STUDENT_PERIOD_CREATED",
    "tenant": "my-school",
    "signature": "nGq8sspzZVWObaR4zUOLyQ29m/IBxxD716hKx5298No=",
    "timestamp": 1727862002901
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://https/#post2';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"id":"b3e6fa78-8672-4e8b-8431-7eebdabd25a2","data":{"id":74,"active":true,"addedAt":"2024-10-02T09:40:02.179+00:00","studentId":76},"type":"STUDENT_PERIOD_CREATED","tenant":"my-school","signature":"nGq8sspzZVWObaR4zUOLyQ29m/IBxxD716hKx5298No=","timestamp":1727862002901}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://https/#post2"

	payload := strings.NewReader("{\n  \"id\": \"b3e6fa78-8672-4e8b-8431-7eebdabd25a2\",\n  \"data\": {\n    \"id\": 74,\n    \"active\": true,\n    \"addedAt\": \"2024-10-02T09:40:02.179+00:00\",\n    \"studentId\": 76\n  },\n  \"type\": \"STUDENT_PERIOD_CREATED\",\n  \"tenant\": \"my-school\",\n  \"signature\": \"nGq8sspzZVWObaR4zUOLyQ29m/IBxxD716hKx5298No=\",\n  \"timestamp\": 1727862002901\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://https/#post2")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"id\": \"b3e6fa78-8672-4e8b-8431-7eebdabd25a2\",\n  \"data\": {\n    \"id\": 74,\n    \"active\": true,\n    \"addedAt\": \"2024-10-02T09:40:02.179+00:00\",\n    \"studentId\": 76\n  },\n  \"type\": \"STUDENT_PERIOD_CREATED\",\n  \"tenant\": \"my-school\",\n  \"signature\": \"nGq8sspzZVWObaR4zUOLyQ29m/IBxxD716hKx5298No=\",\n  \"timestamp\": 1727862002901\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://https/#post2")
  .header("Content-Type", "application/json")
  .body("{\n  \"id\": \"b3e6fa78-8672-4e8b-8431-7eebdabd25a2\",\n  \"data\": {\n    \"id\": 74,\n    \"active\": true,\n    \"addedAt\": \"2024-10-02T09:40:02.179+00:00\",\n    \"studentId\": 76\n  },\n  \"type\": \"STUDENT_PERIOD_CREATED\",\n  \"tenant\": \"my-school\",\n  \"signature\": \"nGq8sspzZVWObaR4zUOLyQ29m/IBxxD716hKx5298No=\",\n  \"timestamp\": 1727862002901\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://https/#post2', [
  'body' => '{
  "id": "b3e6fa78-8672-4e8b-8431-7eebdabd25a2",
  "data": {
    "id": 74,
    "active": true,
    "addedAt": "2024-10-02T09:40:02.179+00:00",
    "studentId": 76
  },
  "type": "STUDENT_PERIOD_CREATED",
  "tenant": "my-school",
  "signature": "nGq8sspzZVWObaR4zUOLyQ29m/IBxxD716hKx5298No=",
  "timestamp": 1727862002901
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://https/#post2");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"id\": \"b3e6fa78-8672-4e8b-8431-7eebdabd25a2\",\n  \"data\": {\n    \"id\": 74,\n    \"active\": true,\n    \"addedAt\": \"2024-10-02T09:40:02.179+00:00\",\n    \"studentId\": 76\n  },\n  \"type\": \"STUDENT_PERIOD_CREATED\",\n  \"tenant\": \"my-school\",\n  \"signature\": \"nGq8sspzZVWObaR4zUOLyQ29m/IBxxD716hKx5298No=\",\n  \"timestamp\": 1727862002901\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "id": "b3e6fa78-8672-4e8b-8431-7eebdabd25a2",
  "data": [
    "id": 74,
    "active": true,
    "addedAt": "2024-10-02T09:40:02.179+00:00",
    "studentId": 76
  ],
  "type": "STUDENT_PERIOD_CREATED",
  "tenant": "my-school",
  "signature": "nGq8sspzZVWObaR4zUOLyQ29m/IBxxD716hKx5298No=",
  "timestamp": 1727862002901
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://https/#post2")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```