trms / cablecast-api-examples Goto Github PK
View Code? Open in Web Editor NEWA place to showcase code snippets using the Cablecast API
License: MIT License
A place to showcase code snippets using the Cablecast API
License: MIT License
I'm working on an integration to manually start and stop live events in cablecast via a Crestron control system. I'm trying to use the forceevents api. Whenever I do a post to that endpoint, I get the response below. I've got the media type header set to text/json. I'm also pretty sure I have the auth set up properly because I'm able to to do get requests for devices and outputs.
The json i'm sending is:
{
"forceEvents": [
"switchEvent": {
"device": 4,
"output": 1
}
]
}
And the response is:
Server Error in '/CablecastAPI' Application.
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /cablecastapi/v1/forceevents
I want to create a page on our website for each and every show we produce. Currently, this is and example of what we have...
http://campbellmedia.org/node/5
This is our page for our government channel. If you go to this page, it gives you links to a page for each and every government show we shoot.
When you click on a show, it takes you to a new page that has a list of each and every episode. They're just listed as text links.
Every time we have a new meeting, i have to go to the website and duplicate one of those links, then change it so it matches up with the new meeting and is labeled correctly.
I want to try and automate this better. I want to be able to use the new API for the public VOD page and create it so that i can create a page for, say for example, Alexandria City Council, and have it display thumbnails of each and every new show from that program. I know that I would need to create a saved search that would give me all shows from project Alexandria City Council that have VOD files with them and displayed in descending order.
I just do not know how to apply this or mess with the API coding
I'm currently working on adding some cool Cablecast integrations features into our new website and I'm having trouble understanding how to send the Authentication header with my request. I'd appreciate it if I can just get a super quick example of sending that header and then carrying out an innocent action like perhaps "POST v1/digitalfiles/{id}/reindex" since any valid file will just get reindexed and be valid again.
Once that's out of the way, I'll be sure to merge my code here. We have some cool examples in the works. Thanks.
EDIT: I made a few new attempts using modified stuff from SO (let's not lie here) and reading the jQuery documentation. The code below (with username, pass, and IP obviously changed to correct values) gives me the following error:
"request header field is not allowed by access-control-allow-headers"
Ideas?
``var username = "plaintextUser";
var password = "plaintextPass";
function make_base_auth(user, password) {
var tok = user + ':' + password;
var hash = btoa(tok);
return "Basic " + hash;
}
$.ajax
({
method: "POST", //use for jquery above 1.9.0 else type: 'POST'
url: "http://xxx.xxx.xxx.xxx/cablecastapi/v1/digitalfiles/867/reindex",
dataType: 'json',
async: false,
beforeSend: function (xhr){
xhr.setRequestHeader('Authorization', make_base_auth(username, password));
},
success: function (){
alert('The file is being reindexed!');
}
});
console.log("Testing connection.");
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.