Download the PHP package day4/blubrry-sdk without Composer
On this page you can find all versions of the php package day4/blubrry-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package blubrry-sdk
Blubrry PHP SDK
The SDK is based on Blubrry API version 2 and you can find the documentation here
Supported Features
- Media Hosting
- Podcast Statistics
- Social Medias
Installation
Blubrry SDK requires PHP v7.2+ to run.
use Blubrry\REST\Api
Authenticating Users
The Blubrry API has OAuth2.0 authentication system.
In way to keep using that authentication system, you will have to implement some thing to make that work. The first step is to contat the Blubrry Support Team and ask them for user credentials to use their API.
After that, you will have to add a button into your Website with a redirect to a link like this:
Where:
Parameters | Description | Type | Optional |
---|---|---|---|
client_id | The client_id that the customer recieved from Blubrry Support Team. | string | no |
redirect_uri | The url that the user should be redirected after login into the Blubrry account. | string | no |
This will return a link like this:
Then, you will have to retrieve a Refresh token for this user:
- getRefresh
Description: Gets Access and Refresh token from Blubrry API.
Parameters | Description | Type | Optional |
---|---|---|---|
clientId | Client Id recieved from Blubrry Team | string | no |
clientSecret | Client Secret recieved from Blubrry | string | no |
code | Response code from User login at Blubrry | string | no |
redirectUri | The url that the user should be redirected after login into the Blubrry account | integer | yes |
Example request:
Example response:
And then, you will use the access_token
to be able to do requests to the another API endpoits.
The access_token
expires in one hour, you will need to save the refresh_token
locally and send a request to the endpoint refreshToken
to retrieve a new access_token
without need of the user loggin into the Blubrry account.
- getNewAccessToken
Description: Updates the Access token using the Refresh Token.
Parameters | Description | Type | Optional |
---|---|---|---|
clientId | Client Id recieved from Blubrry Team | string | no |
clientSecret | Client Secret recieved from Blubrry | string | no |
refreshToken | Response field from getRefresh function | string | no |
Example request:
Example response:
Endpoints
- listPrograms
Description: List Programs from Blubrry.
Parameters | Description | Type | Optional |
---|---|---|---|
start | Specifies the number of results to return. The default is 20, 100 maximum | integer | yes |
limit | Specifies the start position of returned results | integer | yes |
Example request:
Example response:
- listUnpublished
Description: List umpublished Media from Blubrry.
Parameters | Description | Type | Optional |
---|---|---|---|
programKeyword | Specifies the program | string | no |
start | Specifies the number of results to return. The default is 20, 100 maximum | integer | yes |
limit | Specifies the start position of returned results | integer | yes |
Example request:
Example response:
- publishMedia
Description: Publish Media into Blubrry.
Parameters | Description | Type | Optional |
---|---|---|---|
programKeyword | Specifies the program | string | no |
mediafile | Specifies the media file to insert | string | no |
publish | When true, the media file will be made publicly available. | boolean | no |
Example request:
Example response:
- deleteMedia
Description: Delete media from Blubrry
Parameters | Description | Type | Optional |
---|---|---|---|
programKeyword | Specifies the program | string | no |
mediafile | Specifies the media file to delete | string | no |
Example request:
Example response:
- addMigrateMediaUrl
Description: Adds media URLs to the migration queue.
Parameters | Description | Type | Optional |
---|---|---|---|
programKeyword | Specifies the program | string | no |
url | Individual URL to add to migration queue. | string | no |
urls | Multiple URLs separated by new lines to add to migration queue. | Array | yes |
Example request:
Example response:
- removeMigrateMediaUrl
Description: Remove media URLs from the migration queue.
Parameters | Description | Type | Optional |
---|---|---|---|
programKeyword | Specifies the program | string | no |
url | Individual URL to add to migration queue. | string | no |
urls | Multiple URLs separated by new lines to add to migration queue. Send null or [] if you are using url ) |
Array | yes |
ids | One or more unique migrate IDs separated by commas. | Array | no |
Example request:
Example response:
- migrateStatus
Description: Makes the uploaded media file publicly available.
Parameters | Description | Type | Optional |
---|---|---|---|
programKeyword | Specifies the program | string | no |
status | Only returns results with specific status. Status may be any one of queued , downloading , completed , skipped , error or empty string for no specific status |
string | yes |
start | Specifies the number of results to return. The default is 20, 100 maximum | integer | yes |
limit | Specifies the start position of returned results | integer | yes |
ids | One or more unique migrate IDs separated by commas. | Array | yes |
Example request:
Example response:
- uploadMedia
Description: Uploads a media file to the server.
Parameters | Description | Type | Optional |
---|---|---|---|
programKeyword | Specifies the program | string | no |
media_file | Specifies the media file to upload. | string | no |
Example request:
Example response:
- summary
Description: Gets Podcast Summary.
Parameters | Description | Type | Optional |
---|---|---|---|
programKeyword | Specifies the program | string | no |
month | Specific month to pull summary from. | string | yes |
year | Specific year to pull summary from | string | yes |
Example request:
Example response:
- totals
Description: Get totals from a specific podcast, only available to professional statistics accounts.
Note: start-date
and end-date
range cannot exceed 45 days.
Parameters | Sub-Parameters | Description | Type | Optional |
---|---|---|---|---|
programKeyword | - | Specifies the program | string | no |
params | - | Array with the following parameters | Array | no |
- | start-date | A start date for fetching Statistics data. Requests can specify a start date formatted as YYYY-MM-DD. | string | no |
- | end-date | End date for fetching Statistics data. The request can specify an end date formatted as YYYY-MM-DD. | string | yes |
- | fields | Defaults to date, episode, downloads Selector specifying a subset of fields to include in the response. Fields include date (YYYY-MM-DD), episode (media file name), downloads. | string | yes |
- | start | Specifies the number of results to return. The default is 20, 100 maximum | integer | yes |
- | limit | Specifies the start position of returned results | integer | yes |
Example request:
Example response:
- updateListing
Description: Updates the social listing.
Parameters | Sub-Parameters | Description | Type | Optional |
---|---|---|---|---|
programKeyword | - | Specifies the program | string | no |
params | - | Array with the following parameters | Array | no |
- | title | Title of the podcast episode. | string | no |
- | date | Date in RFC 2822 format | string | no |
- | mediaUrl | Podcast enclosure “url” value, must be a complete URL with protocol schema. | string | no |
- | filesize | File size in bytes, this is the Podcast enclosure "length". Value should not be formatted, should not include commas. | string | no |
- | feedUrl | The RSS feed URL for the specified podcast. Do not try to insert with the podcast episode data, will be used for a different purpose. | string | yes |
- | guid | RSS item guid value. If not specified, the media-url is used as the guid value. | string | yes |
- | subtitle | iTunes Subtitle of podcast episode, or the first 255 characters of blog post | string | yes |
- | duration | iTunes duration, specified in hh:mm:ss | string | yes |
- | explicit | iTunes explicit value, values can be one of: yes , no , clean . Default set to no |
string | yes |
- | link | RSS item “link” value, should be complete URL to the blog post or page associated with the podcast episode. | string | yes |
- | image | RSS item "itunes:image" value or the episode’s official image in square coverart form, should be a complete URL to the episode specific image. | string | yes |
Example request:
Example response:
- getSocial
Description: Get Social Options.
Parameters | Sub-Parameters | Description | Type | Optional |
---|---|---|---|---|
programKeyword | - | Specifies the program | string | no |
params | - | Array with the following parameters | Array | no |
- | social-type | Array with all of the another parameters | array | no |
- | podcast-id | ID of podcast to post to social. | string | no |
- | post-data | Destinations to post to with specified parameters | string | no |
- | social-id | Destination social ID which is the meta_id value of the social network settings in the programs_meta database table. | string | no |
- | social-image | URL to an image to represent the social network in a web page form. | string | no |
- | social-title | Title of social destination | string | yes |
- | form-data | This is an array of items of key/value pairs. The options are for generating the form and mapping the values to fields for the eventual post to social endpoints. | Array | yes |
- | row-type | Specifies type of row to enter into form. Currently supported types: input-text, input-checkbox | string | yes |
- | row-order | Order number for the row to appear in form. Number starts with 1 and increments upward. | string | yes |
- | row-attributes | Row attributes if row type is HTML |
array | yes |
- | content | Raw HTML text to be displayed in on page. | string | yes |
- | row-attributes | Social data array if social-type is input-text |
Array | yes |
- | label | Title of input, placed above input wrapped within a label tag. | string | yes |
- | placeholder | Placeholder within input. | string | yes |
- | help-text | Text to go below input box. | string | yes |
- | rows | Number of rows for input box. Default if not specified is 1. If 2 or more, the textarea tag is used instead of input. | string | yes |
- | maxlength | Maximum character length for the input box. | string | yes |
- | name | Name of input field | string | yes |
- | value | Value for input field | string | yes |
- | row-attributes | Social data array if social-type is input-checkbox |
Array | yes |
- | label | Title of input, placed to the right of checkbox within a label tag. | string | yes |
- | checked | Value of either blank (not checked) or 'checked' to indicate that the input should be checked upon initial loading. | string | yes |
- | name | Name of input field (only used once). | string | yes |
- | value | Value of input field | string | yes |
- | row-attributes | Social data array if social-type is input-radio |
Array | yes |
- | label | Title of input, placed to the right of checkbox within a label tag. | string | yes |
- | checked | Value of either blank (not checked) or 'checked' to indicate that the input should be checked upon initial loading. | string | yes |
- | name | Name of input field (may be used multiple times to indicate a series of checkboxes) | string | yes |
- | value | Value of input field | string | yes |
Example request:
Example response:
- postSocial
Description: Post to Social.
Parameters | Sub-Parameters | Description | Type | Optional |
---|---|---|---|---|
programKeyword | - | Specifies the program | string | no |
body | - | Array with the following parameters | Array | no |
- | podcast-id | ID of podcast to post to social. | string | no |
- | post-data | Destinations to post to with specified parameters | string | no |
- | social-id | Destination social ID which is the meta_id value of the social network settings in the programs_meta database table. | string | no |
- | social-type | Type of destination, not limited to but currently supported values: twitter, facebook, youtube | string | no |
- | social-data | Array of data to be posted to the specified social network | string | no |
- | social-data | Social data array if social-type is twitter | Array | yes |
- | content–{SOCIAL-ID} | Message to post to twitter. Character limit: 140 | string | no |
- | social-data | Social data array if social-type is facebook | Array | yes |
- | title–{SOCIAL-ID} | Title of media file. Character limit: 90 | string | yes |
- | description–{SOCIAL-ID} | Posting content to Facebook wall or fan page. Character limit: 4000 | string | yes |
- | destination-{SOCIAL-ID}-{PAGE-ID} | One or more facebook destinations. | string | yes |
- | social-data | Social data array if social-type is Youtube | Array | yes |
- | title–{SOCIAL-ID} | Title of posting to YouTube. Character limit: 100 | string | yes |
- | description–{SOCIAL-ID} | Description of posting to YouTube. Character limit: 4000 | string | yes |
Example request:
Example response:
LICENSE
This SDK is open source with a public repository on GitHub.