> 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.

# GetAssignment

GET https://api.dreamclass.io/dreamclassapi/v1/assignments/get/{assignmentId}

Get a single assignment.

Input variables

- assignmentId: id of the assignment. Check the GetAssignments call

Same shape as an entry of GetAssignments. The assignment must belong to one of your school's periods.

Reference: https://apidoc.dreamclass.io/dream-class-api/assignments/get-assignment

## Servers

- `https://api.dreamclass.io` (https://api.dreamclass.io, default)
- `https://your-webhook-url` (https://your-webhook-url)

## Request

### Path parameters

- `assignmentId` (string, required)

### Headers

- `dreamclass-secret-key` (string, optional) — Your DreamClass API key. Required on every request. Find it in the DreamClass app under Settings > Integrations.
- `tenant` (string, optional) — Your tenant code: the DreamClass subdomain you sign in at (for https://myaccount.dreamclass.io it is "myaccount"), or your full white-labelled domain. Required on every request.
- `schoolCode` (string, optional) — Your school code. Required on every request. Find it in the DreamClass app under Settings > Integrations.

## Response

### 200

OK

- `id` (integer, required)
- `title` (string, required)
- `instructions` (string, required)
- `status` (integer, required)
- `startDate` (date, required)
- `dueDate` (date, required)
- `dueTime` (string, required)
- `guid` (string, required)
- `electronicSubmission` (boolean, required)
- `allowLateSubmission` (boolean, required)
- `classCourseId` (integer, required)
- `professorSemesterInfoId` (integer, required)
- `simpleGradeId` (integer, required)
- `createdAt` (datetime, required)
- `updatedAt` (datetime, required)

## Examples

**Response**

```json
{
  "id": 678,
  "title": "Algebra homework 1",
  "instructions": "<p>Complete exercises 1-10.</p>",
  "status": 2,
  "startDate": "2026-06-01",
  "dueDate": "2026-06-08",
  "dueTime": "23:59:00",
  "guid": "a1b2c3",
  "electronicSubmission": true,
  "allowLateSubmission": false,
  "classCourseId": 45,
  "professorSemesterInfoId": 87,
  "simpleGradeId": 564,
  "createdAt": "2026-05-30T12:00:00.000+00:00",
  "updatedAt": "2026-05-31T09:00:00.000+00:00"
}
```

**SDK Code**

```python GetAssignment
import requests

url = "https://api.dreamclass.io/dreamclassapi/v1/assignments/get/assignmentId"

headers = {
    "dreamclass-secret-key": "{{apiKey}}",
    "tenant": "{{tenant}}",
    "schoolCode": "{{schoolCode}}"
}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript GetAssignment
const url = 'https://api.dreamclass.io/dreamclassapi/v1/assignments/get/assignmentId';
const options = {
  method: 'GET',
  headers: {
    'dreamclass-secret-key': '{{apiKey}}',
    tenant: '{{tenant}}',
    schoolCode: '{{schoolCode}}'
  }
};

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

```go GetAssignment
package main

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

func main() {

	url := "https://api.dreamclass.io/dreamclassapi/v1/assignments/get/assignmentId"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("dreamclass-secret-key", "{{apiKey}}")
	req.Header.Add("tenant", "{{tenant}}")
	req.Header.Add("schoolCode", "{{schoolCode}}")

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

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

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

}
```

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

url = URI("https://api.dreamclass.io/dreamclassapi/v1/assignments/get/assignmentId")

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

request = Net::HTTP::Get.new(url)
request["dreamclass-secret-key"] = '{{apiKey}}'
request["tenant"] = '{{tenant}}'
request["schoolCode"] = '{{schoolCode}}'

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

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

HttpResponse<String> response = Unirest.get("https://api.dreamclass.io/dreamclassapi/v1/assignments/get/assignmentId")
  .header("dreamclass-secret-key", "{{apiKey}}")
  .header("tenant", "{{tenant}}")
  .header("schoolCode", "{{schoolCode}}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.dreamclass.io/dreamclassapi/v1/assignments/get/assignmentId', [
  'headers' => [
    'dreamclass-secret-key' => '{{apiKey}}',
    'schoolCode' => '{{schoolCode}}',
    'tenant' => '{{tenant}}',
  ],
]);

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

```csharp GetAssignment
using RestSharp;

var client = new RestClient("https://api.dreamclass.io/dreamclassapi/v1/assignments/get/assignmentId");
var request = new RestRequest(Method.GET);
request.AddHeader("dreamclass-secret-key", "{{apiKey}}");
request.AddHeader("tenant", "{{tenant}}");
request.AddHeader("schoolCode", "{{schoolCode}}");
IRestResponse response = client.Execute(request);
```

```swift GetAssignment
import Foundation

let headers = [
  "dreamclass-secret-key": "{{apiKey}}",
  "tenant": "{{tenant}}",
  "schoolCode": "{{schoolCode}}"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.dreamclass.io/dreamclassapi/v1/assignments/get/assignmentId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

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()
```