> This page is for Camera to Cloud.

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

# 디바이스 코드 요청

POST https://api.frame.io/v2/auth/device/code
Content-Type: multipart/form-data



Reference: https://next.developer.frame.io/camera-to-cloud/api-reference/authentication/device-request-code

## Request

### Headers

- `x-client-version` (string, optional, default: 0.0.0) — Firmware or software version of a C2C integration. Will be used to determine the correct Device Model configuration for the device when multiple are available. Must be a valid semantic version. For more on semantic versions, see here: https://semver.org/
- `x-client-platypus-enabled` (enum, optional) — Enable URL Pairing mode for C2C device code requests. Set to 'true' to enable.
  - Allowed values: `true`

### Body (multipart/form-data)

This endpoint expects a multipart form.

- `client_id` (string, required) — 물리적 하드웨어 디바이스의 고유 식별자입니다. 이 값은 해당 디바이스에서 고유함이 보장되어야 합니다. 일련번호 또는 무작위로 생성된 UUID를 사용할 수 있습니다.
- `client_secret` (string, required) — Frame.io 지원 팀에서 발급하며 디바이스 모델을 식별합니다. 이 값은 사용자에게 공개되지 않도록 비밀로 유지해야 하며, 저장 시 암호화해야 합니다.
- `scope` (string, required) — 요청 중인 권한의 공백으로 구분된 목록입니다. 하드웨어 디바이스는 다음 scope를 요청할 수 있습니다: 'asset_create'(에셋 생성), 'offline'(토큰 새로 고침). 일반적으로 두 항목을 함께 요청합니다.

## Response

### 200

요청 성공

- `device_code` (string, required) — The device code should be hidden from the user, and is used to identify this authorization request when polling to see if the user has entered their code successfully.
- `expires_in` (double, required) — The number of seconds until this code expires.
- `interval` (double, required) — How long the we should wait between polling requests to see if the user has entered the code.
- `name` (string, required) — The name of the device we are trying to connect.
- `user_code` (string, required) — The six-digit code the user will enter into Frame.io to pair the device to a project.
- `verification_uri` (string, required) — The URL where the user should go to enter the pairing code.
- `verification_uri_complete` (string, optional) — A complete URL with the user code pre-filled, which can be used to streamline the pairing process.

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "device_code": "a1b2C3d4E5f6G7h8I9j0K1L2M3N4O5P6Q7R8S9T0U1V2W3X4Y5Z6a7b8c9d0e1f2g3h4i5j6k7",
  "expires_in": 120,
  "interval": 5,
  "name": "my-device-abc123",
  "user_code": "987654",
  "verification_uri": "https://next.frame.io/pair",
  "verification_uri_complete": "https://next.frame.io/pair/987654"
}
```

**SDK Code**

```typescript
const formData = new FormData();
formData.append('client_id', 'your-client-id');
formData.append('client_secret', 'your-client-secret');
formData.append('scope', 'asset_create offline');

const response = await fetch('https://api.frame.io/v2/auth/device/code', {
  method: 'POST',
  headers: {
    'x-client-platypus-enabled': 'true',
    'x-client-version': '1.0.0'
  },
  body: formData
});

const result = await response.json();
console.log(result);
```

```python
import requests

headers = {
    'x-client-platypus-enabled': 'true',
    'x-client-version': '1.0.0'
}

data = {
    'client_id': 'your-client-id',
    'client_secret': 'your-client-secret',
    'scope': 'asset_create offline'
}

response = requests.post(
    'https://api.frame.io/v2/auth/device/code',
    headers=headers,
    data=data
)

result = response.json()
print(result)
```

```go
package main

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

func main() {

	url := "https://api.frame.io/v2/auth/device/code"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"client_id\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"client_secret\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"scope\"\r\n\r\n\r\n-----011000010111000001101001--\r\n")

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

	req.Header.Add("Content-Type", "multipart/form-data; boundary=---011000010111000001101001")

	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://api.frame.io/v2/auth/device/code")

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

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'multipart/form-data; boundary=---011000010111000001101001'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"client_id\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"client_secret\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"scope\"\r\n\r\n\r\n-----011000010111000001101001--\r\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://api.frame.io/v2/auth/device/code")
  .header("Content-Type", "multipart/form-data; boundary=---011000010111000001101001")
  .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"client_id\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"client_secret\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"scope\"\r\n\r\n\r\n-----011000010111000001101001--\r\n")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.frame.io/v2/auth/device/code', [
  'headers' => [
    'Content-Type' => 'multipart/form-data; boundary=---011000010111000001101001',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.frame.io/v2/auth/device/code");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "multipart/form-data; boundary=---011000010111000001101001");
request.AddParameter("multipart/form-data; boundary=---011000010111000001101001", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"client_id\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"client_secret\"\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"scope\"\r\n\r\n\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "multipart/form-data; boundary=---011000010111000001101001"]
let parameters = [
  [
    "name": "client_id",
    "value": 
  ],
  [
    "name": "client_secret",
    "value": 
  ],
  [
    "name": "scope",
    "value": 
  ]
]

let boundary = "---011000010111000001101001"

var body = ""
var error: NSError? = nil
for param in parameters {
  let paramName = param["name"]!
  body += "--\(boundary)\r\n"
  body += "Content-Disposition:form-data; name=\"\(paramName)\""
  if let filename = param["fileName"] {
    let contentType = param["content-type"]!
    let fileContent = String(contentsOfFile: filename, encoding: String.Encoding.utf8)
    if (error != nil) {
      print(error as Any)
    }
    body += "; filename=\"\(filename)\"\r\n"
    body += "Content-Type: \(contentType)\r\n\r\n"
    body += fileContent
  } else if let paramValue = param["value"] {
    body += "\r\n\r\n\(paramValue)"
  }
}

let request = NSMutableURLRequest(url: NSURL(string: "https://api.frame.io/v2/auth/device/code")! 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()
```