Library

The purpose of the library service is to manage shared libraries. This service supports the following methods:

Method Description

get

Retrieves information on one or more shared libraries.

update

Updates a library's name.

list

Lists each of your libraries.

assets

Lists the assets associated with a library.

add

Adds an asset to a library.

remove

Removes an asset from a library.

Use the Create Library endpoint to create a library.

/api2/library/get

Retrieves information on one or more shared libraries.

Pass the following parameters through the msg parameter:

Request Parameter

Type

Description

id

String

Identify the desired library by its unique ID.

ids

List

Identify each desired library by its unique ID.

Please specify either the id or the ids parameter when requesting this endpoint.

Response body parameters are described below.

Response Parameter

Type

Description

error

Integer

Indicates whether an error occurred.

library | libraries

Dictionary | List

Contains settings for each requested library.

The response for a single library is a single library dictionary, while the response for multiple libraries is a libraries list of dictionaries.

created

Integer

Indicates the Unix time at which the library was created.

desc

String

Indicates a library's name.

id

String

Identifies a library by its system-defined ID.

lastmod

Integer

Indicates the Unix time at which the library was last modified.

owner

String

Identifies the library's owner by its system-defined ID.

Sample request/response that retrieves 1 library:

The Call() function, which is imported from uplynk_api2_auth module, prepares the message body and digital signature.

from uplynk_api2_auth import Call

print(Call('/api2/library/get', id='587ed6b0074178ad8691f1f31ec1c1'))
{	
	'library' : {
		'created' : 1409936370109,
		'desc' : 'My Library',
		'id' : '587ed6b0074178ad8691f1f31ec1c1',
		'lastmod' : 1466462446415,
		'owner' : '52a3024c963a4e5191a1b03c84b10420'
	}
	'error' : 0,
}

Sample request/response that retrieves 1 library:

The Call() function, which is imported from uplynk_api2_auth module, prepares the message body and digital signature.

from uplynk_api2_auth import Call

print(Call('/api2/library/get', ids=['49ldf2g89ab92lec71cda0238c73cd9e', '587ed6b0074178ad8691f1f31ec1c1']))
{
	'libraries' : [{
			'owner' : '52a3024c963a4e5191a1b03c84b10420',
			'lastmod' : 1466615279440,
			'created' : 1479996375109,
			'id' : '49ldf2g89ab92lec71cda0238c73cd9e',
			'desc' : 'My 2nd Library'
		}, {
			'owner' : '52a3024c963a4e5191a1b03c84b10420',
			'lastmod' : 1466462446415,
			'created' : 1409936370109,
			'id' : '587ed6b0074178ad8691f1f31ec1c1',
			'desc' : 'My Library'
		}
	],
	'error' : 0
}

/api2/library/update

Updates a library's name.

Pass the following parameters through the msg parameter:

Request Parameter

Type

Description

id

Required

String

Identify the desired library by its unique ID.

desc

Required

String

Update the library's name to the specified value.

Response body parameters are described below.

Response Parameter

Type

Description

error

Integer

Indicates whether an error occurred.

library

Dictionary

Contains settings for the modified library.

created

Integer

Indicates the Unix time at which the library was created.

desc

String

Indicates the library's name.

id

String

Identifies the library by its system-defined ID.

lastmod

Integer

Indicates the Unix time at which the library was last modified.

owner

String

Identifies the library's owner by its system-defined ID.

Sample request/response:

The Call() function, which is imported from uplynk_api2_auth module, prepares the message body and digital signature.

from uplynk_api2_auth import Call

print(Call('/api2/library/update', id='587ed6b0074178ad8691f1f31ec1c1', desc='My 1st Library'))
{
	'error' : 0,
	'library' : {
		'created' : 1409936370109,
		'desc' : 'My 1st Library',
		'id' : '587ed6b0074178ad8691f1f31ec1c1',
		'lastmod' : 1466462446415,
		'owner' : '52a3024c963a4e5191a1b03c84b10420'
	}
}

/api2/library/list

Lists each of your libraries.

Pass the following parameters through the msg parameter:

Request Parameter

Type

Description

search

String

Filters the response to libraries whose name or system-defined ID matches the specified keyword(s).

limit

Integer

Defines the maximum number of libraries that may be included in the response.

This parameter should not be set above 100.

skip

Integer

Skips the first N results where N represents the value defined by this parameter.

Use the skip and the limit parameters to generate paginated results.

order

String

Sort the results by one of the following fields: desc, created, lastmod, duration, state, and external_id.

Prepend a minus sign to the field name to sort the results in reverse order (e.g., order='-desc' to sort values in reverse alphabetical order).

Response body parameters are described below.

Response Parameter

Type

Description

error

Integer

Indicates whether an error occurred.

libraries

Dictionary

Contains settings for each of your libraries.

created

Integer

Indicates the Unix time at which the library was created.

desc

String

Indicates a library's name.

id

String

Identifies a library by its system-defined ID.

lastmod

Integer

Indicates the Unix time at which the library was last modified.

owner

String

Identifies the library's owner by its system-defined ID.

Sample request/response:

The Call() function, which is imported from uplynk_api2_auth module, prepares the message body and digital signature.

from uplynk_api2_auth import Call

print(Call('/api2/library/list', search='library', order='-created', limit=3))
{
	'error' : 0,
	'libraries' : {
		'created' : 1579996375109,
		'desc' : 'My 3rd Library',
		'id' : '123df2g89ab92lec71cda0238c73ba2c',
		'lastmod' : 1579996375109,
		'owner' : '52a3024c963a4e5191a1b03c84b10420'
	}, {
		'created' : 1479996375109,
		'desc' : 'My 2nd Library',
		'id' : '49ldf2g89ab92lec71cda0238c73cd9e',
		'lastmod' : 1479996375109,
		'owner' : '52a3024c963a4e5191a1b03c84b10420'
	}, {
		'created' : 1409936370109,
		'desc' : 'My Library',
		'id' : '587ed6b0074178ad8691f1f31ec1c1',
		'lastmod' : 1466462446415,
		'owner' : '52a3024c963a4e5191a1b03c84b10420'
	}
}

/api2/library/assets

Lists the assets associated with a library.

Pass the following parameter through the msg parameter:

Request Parameter

Type

Description

id

Required

String

Identify the desired library by its unique ID.

Response body parameters are described below.

Response Parameter

Type

Description

assets

list

Contains a list of assets associated with the specified library.

error

Integer

Indicates whether an error occurred.

Sample request/response:

The Call() function, which is imported from uplynk_api2_auth module, prepares the message body and digital signature.

from uplynk_api2_auth import Call

print(Call('/api2/library/assets', id='587ed6b0074178ad8691f1f31ec1c1'))

{
	'assets' : [{
			'orig_filename' : None,
			'embed_player_url' : 'https://content.uplynk.com/player5/A2331bc89.html',
			'test_player_url' : 'https://content.uplynk.com/player5/84kL1s.html',
			'test_players' : [{
					'url' : 'https://content.uplynk.com/player5/84kL1s.html',
					'expire' : None,
					'params' : '',
					'id' : '26nIkb1kUHsgH2TPZCJoxB',
					'desc' : '26nIkb1kUHsgH2TPZCJoxB'
				}
			],
			'require_drm' : 1,
			'created' : 1460137100103,
			'mp4_url' : 'http://stg-ec-ore-u.uplynk.com/slices/860/a12345c/b678910d/b678910d_g.mp4',
			'autoexpire' : 0,
			'slices' : 0,
			'job_type' : 'vod',
			'libraries' : [{
					'id' : '587ed6b0074178ad8691f1f31ec1c1',
					'desc' : 'My Library'
				}
			],
			'ttml_url' : '',
			'state' : 'ready',
			'rays' : 7,
			'poster_url' : 'https://stg-ec-ore-u.uplynk.com/slices/860/a12345c/b678910d/poster_789abc1.jpg',
			'duration' : 3.814,
			'lastmod' : 1466615288476,
			'external_id' : '',
			'id' : 'b678910d',
			'thumb_url' : 'https://stg-ec-ore-u.uplynk.com/slices/860/a12345c/b678910d/poster_789abc1.jpg',
			'desc' : 'MyVideo1'
		}, {
			'orig_filename' : None,
			'embed_player_url' : 'https://content.uplynk.com/player5/1Kw5JDXfm0PX28mnrEjH4Sea.html',
			'test_player_url' : 'https://content.uplynk.com/player5/2tYOgqT35WW2XkPw6id43Asa.html',
			'test_players' : [{
					'url' : 'https://content.uplynk.com/player5/2tYOgqT35WW2XkPw6id43Asa.html',
					'expire' : None,
					'params' : '',
					'id' : '48849O1sf8',
					'desc' : '48849O1sf8'
				}
			],
			'require_drm' : 1,
			'created' : 1460137000322,
			'mp4_url' : 'http://stg-ec-ore-u.uplynk.com/slices/be3/a12345c/e543219f/e543219f_g.mp4',
			'autoexpire' : 0,
			'slices' : 1,
			'job_type' : 'vod',
			'libraries' : [{
					'id' : '587ed6b0074178ad8691f1f31ec1c1',
					'desc' : 'My Library'
				}
			],
			'ttml_url' : '',
			'state' : 'ready',
			'rays' : 7,
			'poster_url' : 'https://stg-ec-ore-u.uplynk.com/slices/be3/a12345c/e543219f/poster_456ae9.jpg',
			'duration' : 4.511541666666666,
			'lastmod' : 1466615291347,
			'external_id' : '',
			'id' : 'e543219f',
			'thumb_url' : 'https://stg-ec-ore-u.uplynk.com/slices/be3/a12345c/e543219f/poster_456ae9.jpg',
			'desc' : 'Office'
		}
	],
	'error' : 0
}

/api2/library/assets/add

Adds one or more assets to a library.

Pass the following parameters through the msg parameter:

Request Parameter

Type

Description

id

Required

String

Identify the desired library by its unique ID.

assets

Required

List

Identify each asset that will be added to the library by its asset IDThis unique ID identifies an asset. View this ID by navigating to the Content tab, selecting the desired asset, and then viewing the GUID option from the Details tab..

Response body parameters are described below.

Response Parameter

Type

Description

assets

List

Describes each asset that was added to the library.

error

Integer

Indicates whether an error occurred.

Sample request/response:

The Call() function, which is imported from uplynk_api2_auth module, prepares the message body and digital signature.

from uplynk_api2_auth import Call

print(Call('/api2/library/assets/add', id='587ed6b0074178ad8691f1f31ec1c1', assets=['a24d10115', 'b243cd1465']))

{
	'assets' : [{
			'orig_filename' : None,
			'embed_player_url' : 'https://content.uplynk.com/player5/Hk8Vmtwd6mYxmuBNVD5s123.html',
			'test_player_url' : 'https://content.uplynk.com/player5/10v3Hy4dJC5saW.html',
			'test_players' : [{
					'url' : 'https://content.uplynk.com/player5/10v3Hy4dJC5saW.html',
					'expire' : None,
					'params' : '',
					'id' : '10v3Hy4dJC5saW',
					'desc' : '10v3Hy4dJC5saW'
				}
			],
			'require_drm' : 1,
			'created' : 1453140382232,
			'mp4_url' : '',
			'autoexpire' : 0,
			'slices' : 123,
			'job_type' : 'live',
			'libraries' : [{
					'id' : '587ed6b0074178ad8691f1f31ec1c1',
					'desc' : 'My Library'
				}
			],
			'ttml_url' : '',
			'state' : 'ready',
			'rays' : 5,
			'poster_url' : 'https://stg-ec-norcal-u.uplynk.com/slices/517/c823490fca/a24d10115/00000014.jpg',
			'duration' : 500.859637188207,
			'lastmod' : 1466627632427,
			'external_id' : 'extid123',
			'id' : 'a24d10115',
			'thumb_url' : 'https://stg-ec-norcal-u.uplynk.com/slices/517/c823490fca/a24d10115/00000014.jpg',
			'desc' : 'Video21'
		}, {
			'orig_filename' : None,
			'embed_player_url' : 'https://content.uplynk.com/player5/4949123123fasd.html',
			'test_player_url' : 'https://content.uplynk.com/player5/bb72143aC743.html',
			'test_players' : [{
					'url' : 'https://content.uplynk.com/player5/bb72143aC743.html',
					'expire' : None,
					'params' : '',
					'id' : 'b2123c947A',
					'desc' : 'b2123c947A'
				}
			],
			'require_drm' : 1,
			'created' : 1453140291155,
			'mp4_url' : '',
			'autoexpire' : 0,
			'slices' : 8,
			'job_type' : 'live',
			'libraries' : [{
					'id' : '587ed6b0074178ad8691f1f31ec1c1',
					'desc' : 'My Library'
				}
			],
			'ttml_url' : '',
			'state' : 'ready',
			'rays' : 5,
			'poster_url' : 'https://stg-ec-norcal-u.uplynk.com/slices/3da/c823490fca/b243cd1465/00000007.jpg',
			'duration' : 35.20145124716554,
			'lastmod' : 1466627632449,
			'external_id' : '',
			'id' : 'b243cd1465',
			'thumb_url' : 'https://stg-ec-norcal-u.uplynk.com/slices/3da/c823490fca/b243cd1465/00000007.jpg',
			'desc' : 'New'
		}
	],
	'error' : 0
}

/api2/library/assets/remove

Removes one or more assets from your library.

Pass the following parameters through the msg parameter:

Request Parameter

Type

Description

id

Required

String

Identify the desired library by its unique ID.

assets

Required

List

Identify each asset that will be removed from the library by its asset IDThis unique ID identifies an asset. View this ID by navigating to the Content tab, selecting the desired asset, and then viewing the GUID option from the Details tab..

Response body parameters are described below.

Response Parameter

Type

Description

assets

List

Describes each asset that was removed from the library.

error

Integer

Indicates whether an error occurred.

Sample request/response:

The Call() function, which is imported from uplynk_api2_auth module, prepares the message body and digital signature.

from uplynk_api2_auth import Call

print(Call('/api2/library/assets/remove', ids=['a24d10115']))
{
		'assets' : [{
			'orig_filename' : None,
			'embed_player_url' : 'https://content.uplynk.com/player5/Hk8Vmtwd6mYxmuBNVD5s123.html',
			'test_player_url' : 'https://content.uplynk.com/player5/10v3Hy4dJC5saW.html',
			'test_players' : [{
					'url' : 'https://content.uplynk.com/player5/10v3Hy4dJC5saW.html',
					'expire' : None,
					'params' : '',
					'id' : '10v3Hy4dJC5saW',
					'desc' : '10v3Hy4dJC5saW'
				}
			],
			'require_drm' : 1,
			'created' : 1453140382232,
			'mp4_url' : '',
			'autoexpire' : 0,
			'slices' : 123,
			'job_type' : 'live',
			'libraries' : [],
			'ttml_url' : '',
			'state' : 'ready',
			'rays' : 5,
			'poster_url' : 'https://stg-ec-norcal-u.uplynk.com/slices/517/c823490fca/a24d10115/00000014.jpg',
			'duration' : 500.859637188207,
			'lastmod' : 1466627632427,
			'external_id' : 'extid123',
			'id' : 'a24d10115',
			'thumb_url' : 'https://stg-ec-norcal-u.uplynk.com/slices/517/c823490fca/a24d10115/00000014.jpg',
			'desc' : 'Video21'
		}
	],
	'error' : 0
}