Requires the role: | superadmin |
POST | /superadmin/support/cases | Add a new support case | Add a new support case to the company of the currently logged in user, only administrators are allowed to add support cases. |
---|
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports BokaMera.API.ServiceModel.Dtos
Namespace Global
Namespace BokaMera.API.ServiceModel.Dtos
<ApiResponse(Description:="You were unauthorized to call this service", StatusCode:=401)>
<ApiResponse(Description:="You have too low privilegies to call this service", StatusCode:=403)>
<ValidateRequest(Validator:="IsAuthenticated")>
Public Partial Class SuperAdminCreateSupportCase
Implements ICompany
'''<Summary>
'''Enter the company id, if blank company id and you are an admin, your company id will be used.
'''</Summary>
<ApiMember(Description:="Enter the company id, if blank company id and you are an admin, your company id will be used.", IsRequired:=true)>
Public Overridable Property CompanyId As Nullable(Of Guid)
'''<Summary>
'''The case title.
'''</Summary>
<ApiMember(Description:="The case title.")>
Public Overridable Property Title As String
'''<Summary>
'''The case description.
'''</Summary>
<ApiMember(Description:="The case description.")>
Public Overridable Property Description As String
'''<Summary>
'''If the case type id.
'''</Summary>
<ApiMember(Description:="If the case type id.")>
Public Overridable Property CaseTypeId As Integer
'''<Summary>
'''If the case area id.
'''</Summary>
<ApiMember(Description:="If the case area id.")>
Public Overridable Property CaseAreaId As Integer
End Class
Public Partial Class SupportCaseAreaResponse
'''<Summary>
'''The area id
'''</Summary>
<ApiMember(Description:="The area id")>
Public Overridable Property Id As Integer
'''<Summary>
'''The area name
'''</Summary>
<ApiMember(Description:="The area name")>
Public Overridable Property Name As String
'''<Summary>
'''The area description
'''</Summary>
<ApiMember(Description:="The area description")>
Public Overridable Property Description As String
End Class
Public Partial Class SupportCaseAttachmentResponse
'''<Summary>
'''The attachment id
'''</Summary>
<ApiMember(Description:="The attachment id")>
Public Overridable Property Id As Integer
'''<Summary>
'''The attachment file url
'''</Summary>
<ApiMember(Description:="The attachment file url")>
Public Overridable Property FileUrl As String
End Class
Public Partial Class SupportCaseCommentsResponse
'''<Summary>
'''The case id
'''</Summary>
<ApiMember(Description:="The case id")>
Public Overridable Property SupportCaseId As Integer
'''<Summary>
'''The comments id
'''</Summary>
<ApiMember(Description:="The comments id")>
Public Overridable Property Id As Integer
'''<Summary>
'''The case comment
'''</Summary>
<ApiMember(Description:="The case comment")>
Public Overridable Property Comment As String
'''<Summary>
'''The case comment created by
'''</Summary>
<ApiMember(Description:="The case comment created by")>
Public Overridable Property CreatedBy As String
'''<Summary>
'''The case comment created date
'''</Summary>
<ApiMember(Description:="The case comment created date")>
Public Overridable Property Created As Date
End Class
Public Partial Class SupportCaseQueryResponse
Public Sub New()
Comments = New List(Of SupportCaseCommentsResponse)
Attachments = New List(Of SupportCaseAttachmentResponse)
CaseStatusOptions = New List(Of SupportCaseStatusResponse)
CaseTypeOptions = New List(Of SupportCaseTypeResponse)
CaseAreaOptions = New List(Of SupportCaseAreaResponse)
End Sub
'''<Summary>
'''The support case id
'''</Summary>
<ApiMember(Description:="The support case id")>
Public Overridable Property Id As Integer
'''<Summary>
'''The company user id
'''</Summary>
<ApiMember(Description:="The company user id")>
Public Overridable Property CompanyUserId As Guid
'''<Summary>
'''The case title.
'''</Summary>
<ApiMember(Description:="The case title.")>
Public Overridable Property Title As String
'''<Summary>
'''The case description.
'''</Summary>
<ApiMember(Description:="The case description.")>
Public Overridable Property Description As String
'''<Summary>
'''The case status id.
'''</Summary>
<ApiMember(Description:="The case status id.")>
Public Overridable Property CaseStatusId As Integer
'''<Summary>
'''If the case type id.
'''</Summary>
<ApiMember(Description:="If the case type id.")>
Public Overridable Property CaseTypeId As Integer
'''<Summary>
'''If the case area id.
'''</Summary>
<ApiMember(Description:="If the case area id.")>
Public Overridable Property CaseAreaId As Integer
'''<Summary>
'''The case created by.
'''</Summary>
<ApiMember(Description:="The case created by.")>
Public Overridable Property CreatedBy As String
'''<Summary>
'''The case updated by.
'''</Summary>
<ApiMember(Description:="The case updated by.")>
Public Overridable Property UpdatedBy As String
'''<Summary>
'''The case solved by.
'''</Summary>
<ApiMember(Description:="The case solved by.")>
Public Overridable Property SolvedBy As String
'''<Summary>
'''If case updated date.
'''</Summary>
<ApiMember(Description:="If case updated date.")>
Public Overridable Property Updated As Date
'''<Summary>
'''If case created date.
'''</Summary>
<ApiMember(Description:="If case created date.")>
Public Overridable Property Created As Date
'''<Summary>
'''Who owns the support case.
'''</Summary>
<ApiMember(Description:="Who owns the support case.")>
Public Overridable Property CaseOwner As String
'''<Summary>
'''The case status information.
'''</Summary>
<ApiMember(Description:="The case status information.")>
Public Overridable Property CaseStatus As SupportCaseStatusResponse
'''<Summary>
'''The case type information.
'''</Summary>
<ApiMember(Description:="The case type information.")>
Public Overridable Property CaseType As SupportCaseTypeResponse
'''<Summary>
'''The case area information.
'''</Summary>
<ApiMember(Description:="The case area information.")>
Public Overridable Property CaseArea As SupportCaseAreaResponse
'''<Summary>
'''The case comments.
'''</Summary>
<ApiMember(Description:="The case comments.")>
Public Overridable Property Comments As List(Of SupportCaseCommentsResponse)
'''<Summary>
'''The case attachments.
'''</Summary>
<ApiMember(Description:="The case attachments.")>
Public Overridable Property Attachments As List(Of SupportCaseAttachmentResponse)
'''<Summary>
'''The case status options to select from.
'''</Summary>
<ApiMember(Description:="The case status options to select from.")>
Public Overridable Property CaseStatusOptions As List(Of SupportCaseStatusResponse)
'''<Summary>
'''The case type options to select from.
'''</Summary>
<ApiMember(Description:="The case type options to select from.")>
Public Overridable Property CaseTypeOptions As List(Of SupportCaseTypeResponse)
'''<Summary>
'''The case area options to select from.
'''</Summary>
<ApiMember(Description:="The case area options to select from.")>
Public Overridable Property CaseAreaOptions As List(Of SupportCaseAreaResponse)
End Class
Public Partial Class SupportCaseStatusResponse
'''<Summary>
'''The status id
'''</Summary>
<ApiMember(Description:="The status id")>
Public Overridable Property Id As Integer
'''<Summary>
'''The status name
'''</Summary>
<ApiMember(Description:="The status name")>
Public Overridable Property Name As String
'''<Summary>
'''The status description
'''</Summary>
<ApiMember(Description:="The status description")>
Public Overridable Property Description As String
'''<Summary>
'''The status icon
'''</Summary>
<ApiMember(Description:="The status icon")>
Public Overridable Property Icon As String
'''<Summary>
'''The status color
'''</Summary>
<ApiMember(Description:="The status color")>
Public Overridable Property Color As String
End Class
Public Partial Class SupportCaseTypeResponse
'''<Summary>
'''The type id
'''</Summary>
<ApiMember(Description:="The type id")>
Public Overridable Property Id As Integer
'''<Summary>
'''The type name
'''</Summary>
<ApiMember(Description:="The type name")>
Public Overridable Property Name As String
'''<Summary>
'''The type description
'''</Summary>
<ApiMember(Description:="The type description")>
Public Overridable Property Description As String
End Class
End Namespace
End Namespace
VB.NET SuperAdminCreateSupportCase DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /superadmin/support/cases HTTP/1.1
Host: testapi.bokamera.se
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<SuperAdminCreateSupportCase xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
<CaseAreaId>0</CaseAreaId>
<CaseTypeId>0</CaseTypeId>
<CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
<Description>String</Description>
<Title>String</Title>
</SuperAdminCreateSupportCase>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <SupportCaseQueryResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos"> <Attachments> <SupportCaseAttachmentResponse> <FileUrl>String</FileUrl> <Id>0</Id> </SupportCaseAttachmentResponse> </Attachments> <CaseArea> <Description>String</Description> <Id>0</Id> <Name>String</Name> </CaseArea> <CaseAreaId>0</CaseAreaId> <CaseAreaOptions> <SupportCaseAreaResponse> <Description>String</Description> <Id>0</Id> <Name>String</Name> </SupportCaseAreaResponse> </CaseAreaOptions> <CaseOwner>String</CaseOwner> <CaseStatus> <Color>String</Color> <Description>String</Description> <Icon>String</Icon> <Id>0</Id> <Name>String</Name> </CaseStatus> <CaseStatusId>0</CaseStatusId> <CaseStatusOptions> <SupportCaseStatusResponse> <Color>String</Color> <Description>String</Description> <Icon>String</Icon> <Id>0</Id> <Name>String</Name> </SupportCaseStatusResponse> </CaseStatusOptions> <CaseType> <Description>String</Description> <Id>0</Id> <Name>String</Name> </CaseType> <CaseTypeId>0</CaseTypeId> <CaseTypeOptions> <SupportCaseTypeResponse> <Description>String</Description> <Id>0</Id> <Name>String</Name> </SupportCaseTypeResponse> </CaseTypeOptions> <Comments> <SupportCaseCommentsResponse> <Comment>String</Comment> <Created>0001-01-01T00:00:00</Created> <CreatedBy>String</CreatedBy> <Id>0</Id> <SupportCaseId>0</SupportCaseId> </SupportCaseCommentsResponse> </Comments> <CompanyUserId>00000000-0000-0000-0000-000000000000</CompanyUserId> <Created>0001-01-01T00:00:00</Created> <CreatedBy>String</CreatedBy> <Description>String</Description> <Id>0</Id> <SolvedBy>String</SolvedBy> <Title>String</Title> <Updated>0001-01-01T00:00:00</Updated> <UpdatedBy>String</UpdatedBy> </SupportCaseQueryResponse>