TLTR:
From this (https://mixer.com/api/v1/channels/44877492/recordings) api endpoint I receive this value:
id: 302772586 (for example)
but the value that I need is this one:
https://mixer.com/CalypsoVibes?vod=2ArYJv4YfEaJezssnJR15Q
Where CalypsoVibes is the name of the user (I put the id that I return from another endpoint (channels/) and the vod id is something different from an integer.
Long story (not short):
I'm building a section to display the past (n) streams with their link from a user using the Mixer api.
Let's start saying that I didn't even know the existence of that website, so it has been really challenging to understand what data I need.
Here's my script and then I will explain the functionality:
$(() => {
let mixerAPI = 'https://mixer.com/api/v1/';
let streamName = 'GrimlockePrime';
let apiCall = mixerAPI + "channels/" + streamName;
function makeAjaxCall(url, methodType, callback){
$.ajax({
type: 'GET',
url : url,
method : methodType,
dataType : "json",
success : callback,
error : function (reason, xhr){
console.log("error in processing your request",reason);
}
})
}
makeAjaxCall(apiCall, "GET", function(respJson){
console.log(respJson.id);
let streamscall = mixerAPI + "recordings/165804890";
console.log(streamscall);
})
});
From this point, I will make another ajax call, using the id of the user's channel and put it in the record endpoint, to obtain this structure:
https://mixer.com/api/v1/recordings/channelId
The idea is to collect the last (n) streams from a user.
So, starting from a user profile on mixer.com, for example https://mixer.com/CalypsoVibes, I want to collect the last (n) number of streams, which are at the bottom of that section and are called "Past streams".
All of the resources has this structure
https://mixer.com/CalypsoVibes?vod=um8Nx4dNnUqj8E0jcDXKEw
so I probably need the vod id (?vod=id).
Oddly enough, I wasn't able to find any reference of that in the mixer api documentation. So I'm not 100% that I'm looking for the right endpoint.
There are a couple of them that could make the job:
1.https://mixer.com/api/v1/channels/userId/recordings 2.https://mixer.com/api/v1/recordings/id
Both of them will return vod values, but with a caveat which is the fact that they won't return any id or any useful link:
https://vodcontent-6001.xboxlive.com/channel-46362-public/7200a34f-7eca-4f81-822f-677afd4a8d97/
that's just an example of a return, but the id at the end of the url won't match any link from the app.
Does anyone ever had this problem?