(session())
Operations related to session api
- getClips - Retrieve clips of a session
- getAll - Retrieve sessions
- get - Retrieve a session
- getRecorded - Retrieve Recorded Sessions
Retrieve clips of a session
package hello.world;
import java.lang.Exception;
import studio.livepeer.livepeer.Livepeer;
import studio.livepeer.livepeer.models.errors.SDKError;
import studio.livepeer.livepeer.models.operations.GetSessionClipsResponse;
public class Application {
public static void main(String[] args) throws Exception {
try {
Livepeer sdk = Livepeer.builder()
.apiKey("<YOUR_BEARER_TOKEN_HERE>")
.build();
GetSessionClipsResponse res = sdk.session().getClips()
.id("<value>")
.call();
if (res.data().isPresent()) {
// handle response
}
} catch (SDKError e) {
// handle exception
throw e;
} catch (Exception e) {
// handle exception
throw e;
}
}
}
Parameter | Type | Required | Description |
---|---|---|---|
id |
String | ✔️ | ID of the parent session |
Error Object | Status Code | Content Type |
---|---|---|
models/errors/SDKError | 4xx-5xx | */* |
Retrieve sessions
package hello.world;
import java.lang.Exception;
import studio.livepeer.livepeer.Livepeer;
import studio.livepeer.livepeer.models.errors.SDKError;
import studio.livepeer.livepeer.models.operations.GetSessionsResponse;
public class Application {
public static void main(String[] args) throws Exception {
try {
Livepeer sdk = Livepeer.builder()
.apiKey("<YOUR_BEARER_TOKEN_HERE>")
.build();
GetSessionsResponse res = sdk.session().getAll()
.call();
if (res.data().isPresent()) {
// handle response
}
} catch (SDKError e) {
// handle exception
throw e;
} catch (Exception e) {
// handle exception
throw e;
}
}
}
Error Object | Status Code | Content Type |
---|---|---|
models/errors/SDKError | 4xx-5xx | */* |
Retrieve a session
package hello.world;
import java.lang.Exception;
import studio.livepeer.livepeer.Livepeer;
import studio.livepeer.livepeer.models.errors.SDKError;
import studio.livepeer.livepeer.models.operations.GetSessionResponse;
public class Application {
public static void main(String[] args) throws Exception {
try {
Livepeer sdk = Livepeer.builder()
.apiKey("<YOUR_BEARER_TOKEN_HERE>")
.build();
GetSessionResponse res = sdk.session().get()
.id("<value>")
.call();
if (res.session().isPresent()) {
// handle response
}
} catch (SDKError e) {
// handle exception
throw e;
} catch (Exception e) {
// handle exception
throw e;
}
}
}
Parameter | Type | Required | Description |
---|---|---|---|
id |
String | ✔️ | ID of the session |
Error Object | Status Code | Content Type |
---|---|---|
models/errors/SDKError | 4xx-5xx | */* |
Retrieve Recorded Sessions
package hello.world;
import java.lang.Exception;
import studio.livepeer.livepeer.Livepeer;
import studio.livepeer.livepeer.models.errors.SDKError;
import studio.livepeer.livepeer.models.operations.GetRecordedSessionsResponse;
import studio.livepeer.livepeer.models.operations.Record;
public class Application {
public static void main(String[] args) throws Exception {
try {
Livepeer sdk = Livepeer.builder()
.apiKey("<YOUR_BEARER_TOKEN_HERE>")
.build();
GetRecordedSessionsResponse res = sdk.session().getRecorded()
.parentId("<value>")
.record(Record.of(true))
.call();
if (res.data().isPresent()) {
// handle response
}
} catch (SDKError e) {
// handle exception
throw e;
} catch (Exception e) {
// handle exception
throw e;
}
}
}
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
parentId |
String | ✔️ | ID of the parent stream | |
record |
Optional | ➖ | Flag indicating if the response should only include recorded sessions |
true |
Error Object | Status Code | Content Type |
---|---|---|
models/errors/SDKError | 4xx-5xx | */* |