Report the post and comment SDK methods - GluedIn developer
Report Method
Method Method detail
getVideoReportOptions() Convenient getter method to report option data set, so users can choose and send with postReport setter method.
submitVideoReport() Convenient setter method to report a post data set.
postContentReport() Convenient setter method to report a comment data set.
getContentReportOptions() Convenient getter method to report comment list data set, so user can choose which comment he has to hide or show as reported.
  • Get Report reasons option list data:
    API Class : ReportData
    Method : getVideoReportOptions
    Convenient getter method to report option data set, so users can choose and send with postReport setter method.
    Request:
    Requested parameter.
    This getter method does not accept any parameter.
    
    ReportData.sharedInstance.getVideoReportOptions( success: { VideoReportModel in
                //VideoReportModel.data //Content metadata to use in further in report option list to bind with model and view
            }, failure: { [weak self] error in
                guard let weakSelf = self else { return }
                // Action for Fail
            })
    Response:
    • Response Object : Video Report Response Object
    • Success : “True/False”
    • StatusCode : “Status code to know response status from API”
    • Message : “Report message”
    • Data : Will give Reason array
  • Report a Post with reason data:
    API Class : ReportData
    Method : submitVideoReport
    Use : Convenient setter method to report a post data set.
    Request:
    // Requested parameter.
    /*
    Method will help to submit report
        // Call to submit report on user
        */
        
    userId: Loggedin userid
    actingUserId: User is which has created post
    assetId: postid
    Reason: Selected reason which we have selected from reason api
    ReportData.sharedInstance.submitVideoReport(userId:"7bae3c9cdc78",
             actingUserId: "e872faa75753",
             assetId: "231ba72f123c",
             reason: "Scam") {result in
             print(result)
     } failure: {error, code in
              print(error)
              print(code)
             // Do something with error and code
    }
    Response:
    • Response Object : Video Report Response Object
    • Keys which object have:
    • Success : “True/False”
    • StatusCode : “Status code to know response status from API”
    • Message : “Report message”
  • Report a comment with reason data:
    API Class : ReportData
    Method : postContentReport
    Convenient setter method to report a comment data set.
    Request:
    
    // Call to submit report on comment
    Requested parameter.
    userId: Loggedin userid
    Reason : selected reason
    Event: comment
    actingUserId: User is which has created post
    assetId: postid
    postIs: Selected post video id
    ReportData.sharedInstance.postContentReport(userId: "7bae3c9cdc78",
                actingUserId: "e872faa75753",
                reason: "spam or fraud",
                event: "report",
                type: "comment",
                postId: "") {result in
                print( result?.reason as Any)
    } failure: {error, code in
                print( error)
                print(code)
    }
    
    
    Response:
    • Response Object : Video Report Response Object
    • Keys which object have:
    • Success : “True/False”
    • StatusCode : “Status code to know response status from API”
    • Message : “Report message”
  • Get Reported comment list data:
    API Class : ReportData
    Method : getContentReportOptions
    Convenient getter method to report comment list data set, so user can choose which comment he has to hide or show as reported.
    Request:
    Requested parameter.
    This getter method does not accept any parameter.
    // Call to get comment reports user methods
    ReportData.sharedInstance.getContentReportOptions( success: { reports in
          print(reports as Any)    //reports //Content metadata to use in further in report option list to bind with model and view
            }, failure: {error,code in
                // Action for Fail
                print(error)
                print(code)
    })
    
    Response:
    • Response Object : Video Report Response Object
    • Keys which object have:
    • Comment : String array to send comment list
    • user : String array to send list of users reported
    • Video : String of array to send list of reported video
Start for free, pay as you grow
No credit card required.