Welcome to the Panopto Community

Please note: All new registrants to the Panopto Community Forum must be approved by a forum moderator or admin. As such, if you navigate to a feature that is members-only, you may receive an error page if your registration has not yet been approved. We apologize for any inconvenience and are approving new members as quickly as possible.

Rest API - Response Code of 500 when attempting to create a new scheduled recording

edited May 2021 in API

Hi all. I'm trying to create a scheduled Recording with a Post & I'm currently getting a response code of 500 returned.

Seeing as this is an internal server error I'm wondering if anyone has any suggestions on how to narrow down the issue.

My methods for getting, deleting are all working.

my url command looks like this : "api/v1/scheduledRecordings?resolveConflicts=false"

my jsonData before encoding looks like this :

"{

\"Name\":\"prtest1\",

\"Description\":\"just a test\",

\"StartTime\":\"2021-05-26T04:00:00Z\",

\"EndTime\":\"2021-05-26T04:00:00Z\",

\"FolderId\":\"956036d9-432f-4e41-b61c-ad2d0128cb19\",

\"IsBroadcast\":false,

\"Recorders\":

{\"RemoteRecorderId\":\"06783eb0-0ed3-410a-9a36-acca011e44f7\",

\"SuppressPrimary\":false,

\"SuppressSecondary\":false

}}"


The HttpContent is being set as :

HttpContent content = new StringContent(jsonData, Encoding.UTF8, "application/json");

Some things I've tried without success are 

* Granting admin rights to the API user for this remote recorder.

* Setting the Recorders, FolderId & Description to null before posting..

* Created a scheduled Recording through Panopto's UI with no issue. Then retrieved this scheduled recording via the id & passed this object into the api & am still getting the 500 response.

  

Thanks in advance,

Paul

Answers

  • Joe MalmstenJoe Malmsten Panopto Employee

    Hi,


    It looks like Recorders is an object when it should be an array even if there is only a single recorder inside of it. Could you please try to make Recorders an array and see if that solves your issue?


    Thanks,

    Joe

  • edited May 2021

    Hi Joe, good catch. I converted the Recorders to a list & am now getting a response code of 400... I'll take that as progress ;)

    Currently the json data looks like this.

     "{

    "Name":"prNewtest1",

    "Description":"just a test",

    "StartTime":"2021-05-27T14:11:19.19Z",

    "EndTime":"2021-05-27T16:11:19.19Z",

    "FolderId":"956036d9-432f-4e41-b61c-ad2d0128cb19",

    "IsBroadcast":false,

    "Recorders":[{

    "RemoteRecorderId":"06783eb0-0ed3-410a-9a36-acca011e44f7",

    "SuppressPrimary":true,

    "SuppressSecondary":true}]

    }"

  • So I'm still getting a 400, bad request.

    The remote recorder I'm trying to create a schedule for is currently disconnected as it was just a demo & we had to send it back & are getting a new one next week. Does anyone know if the recorder has to be currently active in order for this process to submit? Just running out of things to try & test as the data seems to be structured exactly as the documentation states.


    Just to have the json exactly the same as the documentation I changed the order to the following:


    {

    "Name":"prtest1",

    "Description":"just a test",

    "StartTime":"2021-05-27T16:22:24.24Z",

    "EndTime":"2021-05-27T18:22:24.24Z",

    "FolderId":"29f03769-85a0-4619-9fae-acd4012bac43",

    "Recorders":[

    {

    "RemoteRecorderId":"06783eb0-0ed3-410a-9a36-acca011e44f7",

    "SuppressPrimary":true,

    "SuppressSecondary":false

    }

    ],

    "IsBroadcast":false

    }

  • Hiroshi OhnoHiroshi Ohno Panopto Employee

    Hi Paul,

    It is not necessarily true that API cannot schedule for the offline recorder, but it is true that you cannot do so if the recorder has not previously configured with valid device configuration. I would like ask you to schedule a recording from Panopto UI first. If you still unable to schedule a recording from API to the recorder but you may do so from Panopto UI, please reply back.

  • Hi there. It has been set up and I have been able to successfully schedule through the UI. I am still getting a response code 400 from using the API.

    Thanks
  • Hiroshi OhnoHiroshi Ohno Panopto Employee

    Hi Paul,

    Thank you for checking. I now realized that you specify SuppressPrimary = true.

    It does not work to create a new scheduling recording because a recording requires a primary stream. I think you actually see that reason inside the response like "Message": "At least one recorder must be recording a primary stream".

    I realize that the example our API doc is misleading because it has SuppressPrimary = true.

    This parameter (SuppressPrimary = true) is for future extension of API to allow adding secondary remote recorder to the existing scheduled recordings, but that feature has not been provided yet.

    I hope you may be unblocked by SuppressPrimary = false.

  • Hi Hiroshi.

    Setting SuppressPrimary to false was indeed the issue. Just got a 200 response code.

    Thank you very much for your help!

Sign In or Register to comment.