# \OpenTokArchive

Represents an archive of an OpenTok session.

## Summary

Methods
Properties
Constants
stop()
delete()
toJson()
$createdAt
$duration
$id
$name
$partnerId
$reason
$sessionId
$size
$status
$url
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

File
  Archive.php
Package
Class hierarchy
  \OpenTok\Archive

## Tags

todo |

## Properties

### $createdAt

    $createdAt : int

The time at which the archive was created, in milliseconds since the UNIX epoch.

#### Type

int

#

## Tags

None found

### $duration

    $duration : string

The duration of the archive, in milliseconds.

#### Type

string

#

## Tags

None found

### $id

    $id : string

The archive ID.

#### Type

string

#

## Tags

None found

### $name

    $name : string

The name of the archive. If no name was provided when the archive was created, this is set to null.

#### Type

string

#

## Tags

None found

### $partnerId

    $partnerId : string

The API key associated with the archive.

#### Type

string

#

## Tags

None found

### $reason

    $reason : string

For archives with the status "stopped", this can be set to "90 mins exceeded", "failure", "session ended", or "user initiated". For archives with the status "failed", this can be set to "system failure".

#### Type

string

#

## Tags

None found

### $sessionId

    $sessionId : string

The session ID of the OpenTok session associated with this archive.

#### Type

string

#

## Tags

None found

### $size

    $size : string

The size of the MP4 file. For archives that have not been generated, this value is set to 0.

#### Type

string

#

## Tags

None found

### $status

    $status : string

The status of the archive, which can be one of the following:

- "available" -- The archive is available for download from the OpenTok cloud.
- "expired" -- The archive is no longer available for download from the OpenTok cloud.
- "failed" -- The archive recording failed.
- "started" -- The archive started and is in the process of being recorded.
- "stopped" -- The archive stopped recording.
- "uploaded" -- The archive is available for download from the the upload target Amazon S3 bucket or Windows Azure container you specified at the OpenTok dashboard.

#### Type

string

#

## Tags

None found

### $url

    $url : string

The download URL of the available MP4 file. This is only set for an archive with the status set to "available"; for other archives, (including archives with the status "uploaded") this property is set to null. The download URL is obfuscated, and the file is only available from the URL for 10 minutes. To generate a new URL, call the Archive.listArchives() or OpenTok.getArchive() method.

#### Type

string

#

## Tags

None found

## Methods

### stop()

    stop()

Stops the OpenTok archive, if it is being recorded.

Archives automatically stop recording after 90 minutes or when all clients have disconnected from the session being archived.

#### Throws

\OpenTok\Exception\ArchiveException

  The archive is not being recorded.

#

## Tags

todo |

### delete()

    delete()

Deletes an OpenTok archive.

You can only delete an archive which has a status of "available", "uploaded", or "deleted". Deleting an archive removes its record from the list of archives. For an "available" archive, it also removes the archive file, making it unavailable for download. For a "deleted" archive, the archive remains deleted.

#### Throws

\OpenTok\Exception\ArchiveException

  There archive status is not "available", "updated", or "deleted".

#

## Tags

todo |

### toJson()

    toJson()

Returns a JSON representation of this Archive object.

#

## Tags

todo |

### Archive.php