Platform API

<back to all web services

SaveAutoInspection

Add or update an inspection automation for an object

Requires Authentication
The following routes are available for this service:
PUT/api/automation/inspection/{AutomationId}
POST/api/automation/inspection
Imports System
Imports System.IO
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports Eros.Subtle.Canvara.WebAPIModel.ServiceModel
Imports Eros.Saguna.Common.WebAPIModel.Models

Namespace Global

    Namespace Eros.Saguna.Common.WebAPIModel.Models

        Public Partial Class AutoInspectionModel
            Inherits AutomationModel
            '''<Summary>
            '''The inspection type for the template.
            '''</Summary>
            <ApiMember(Description:="The inspection type for the template.", ParameterType:="query")>
            Public Overridable Property InspectionTypeId As Guid

            '''<Summary>
            '''The template to base the new inspection on.
            '''</Summary>
            <ApiMember(Description:="The template to base the new inspection on.", ParameterType:="query")>
            Public Overridable Property InspectionTemplateId As Guid

            '''<Summary>
            '''The inspector chosen for this inspection will be a contact linked to the project in this role. If no one matches the description, the inspector is not set. 
            '''</Summary>
            <ApiMember(Description:="The inspector chosen for this inspection will be a contact linked to the project in this role. If no one matches the description, the inspector is not set. ", ParameterType:="query")>
            Public Overridable Property ContactRoleId As Guid

            '''<Summary>
            '''If this is true, then if a project inspection for this template already exists, we will not create another inspection.
            '''</Summary>
            <ApiMember(Description:="If this is true, then if a project inspection for this template already exists, we will not create another inspection.", ParameterType:="query")>
            Public Overridable Property IgnoreIfExists As Boolean
        End Class

        Public Partial Class AutomationModel
            '''<Summary>
            '''The unique automation Id
            '''</Summary>
            <ApiMember(Description:="The unique automation Id", ParameterType:="query")>
            Public Overridable Property AutomationId As Guid

            '''<Summary>
            '''The automation type Id
            '''</Summary>
            <ApiMember(Description:="The automation type Id", ParameterType:="query")>
            Public Overridable Property AutomationTypeId As Guid

            '''<Summary>
            '''The automation type
            '''</Summary>
            <ApiMember(Description:="The automation type", ParameterType:="query")>
            Public Overridable Property AutomationType As String

            '''<Summary>
            '''The object this automation applies to
            '''</Summary>
            <ApiMember(Description:="The object this automation applies to", ParameterType:="query")>
            Public Overridable Property ObjectId As Guid

            '''<Summary>
            '''The object name this automation applies to
            '''</Summary>
            <ApiMember(Description:="The object name this automation applies to", ParameterType:="query")>
            Public Overridable Property ObjectName As String

            '''<Summary>
            '''The Id of the object type that this automation applies to. 
            '''</Summary>
            <ApiMember(Description:="The Id of the object type that this automation applies to. ", ParameterType:="query")>
            Public Overridable Property RmsTableCtxIdObject As Guid

            '''<Summary>
            '''The name of the object type that this automation applies to.
            '''</Summary>
            <ApiMember(Description:="The name of the object type that this automation applies to.", ParameterType:="query")>
            Public Overridable Property RmsTableCtxName As String

            '''<Summary>
            '''A guid list containing the selected system action Id's that trigger this automation.
            '''</Summary>
            <ApiMember(Description:="A guid list containing the selected system action Id's that trigger this automation.", ParameterType:="query")>
            Public Overridable Property ActionList As List(Of Guid)

            '''<Summary>
            '''A comma separated string of the selected system action names that trigger this automation.
            '''</Summary>
            <ApiMember(Description:="A comma separated string of the selected system action names that trigger this automation.", ParameterType:="query")>
            Public Overridable Property Actions As String

            '''<Summary>
            '''Name of the automation.
            '''</Summary>
            <ApiMember(Description:="Name of the automation.", ParameterType:="query")>
            Public Overridable Property Name As String

            '''<Summary>
            '''Description of the automation
            '''</Summary>
            <ApiMember(Description:="Description of the automation", ParameterType:="query")>
            Public Overridable Property Description As String

            '''<Summary>
            '''Owner Contact Id
            '''</Summary>
            <ApiMember(Description:="Owner Contact Id", ParameterType:="query")>
            Public Overridable Property OwnerContactId As Guid

            '''<Summary>
            '''Record Status of the automation.
            '''</Summary>
            <ApiMember(Description:="Record Status of the automation.", ParameterType:="query")>
            Public Overridable Property RecordStatus As String
        End Class
    End Namespace

    Namespace Eros.Subtle.Canvara.WebAPIModel.ServiceModel

        <ApiResponse(Description:="List of automations that are setup for an object")>
        Public Partial Class GetAutomationsForObjectResponse
            '''<Summary>
            '''List of automations.
            '''</Summary>
            <ApiMember(Description:="List of automations.")>
            Public Overridable Property Automations As List(Of AutomationModel)

            Public Overridable Property ResponseStatus As ResponseStatus
        End Class

        '''<Summary>
        '''Add or update an inspection automation for an object
        '''</Summary>
        <Api(Description:="Add or update an inspection automation for an object")>
        Public Partial Class SaveAutoInspection
            '''<Summary>
            '''Details of the automation to be added or updated.
            '''</Summary>
            <ApiMember(Description:="Details of the automation to be added or updated.", ParameterType:="query")>
            Public Overridable Property Automation As AutoInspectionModel

            '''<Summary>
            '''Id of the automation.
            '''</Summary>
            <ApiMember(Description:="Id of the automation.", ParameterType:="path")>
            Public Overridable Property AutomationId As Guid
        End Class
    End Namespace
End Namespace

VB.NET SaveAutoInspection DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv

HTTP + CSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /api/automation/inspection HTTP/1.1 
Host: pfapi.pstpf.com.au 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"Automation":{"InspectionTypeId":"00000000-0000-0000-0000-000000000000","InspectionTemplateId":"00000000-0000-0000-0000-000000000000","ContactRoleId":"00000000-0000-0000-0000-000000000000","IgnoreIfExists":false,"AutomationId":"00000000-0000-0000-0000-000000000000","AutomationTypeId":"00000000-0000-0000-0000-000000000000","AutomationType":"String","ObjectId":"00000000-0000-0000-0000-000000000000","ObjectName":"String","RmsTableCtxIdObject":"00000000-0000-0000-0000-000000000000","RmsTableCtxName":"String","ActionList":["00000000-0000-0000-0000-000000000000"],"Actions":"String","Name":"String","Description":"String","OwnerContactId":"00000000-0000-0000-0000-000000000000","RecordStatus":"String"},"AutomationId":"00000000-0000-0000-0000-000000000000"}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"Automations":[{"AutomationId":"00000000-0000-0000-0000-000000000000","AutomationTypeId":"00000000-0000-0000-0000-000000000000","AutomationType":"String","ObjectId":"00000000-0000-0000-0000-000000000000","ObjectName":"String","RmsTableCtxIdObject":"00000000-0000-0000-0000-000000000000","RmsTableCtxName":"String","ActionList":["00000000-0000-0000-0000-000000000000"],"Actions":"String","Name":"String","Description":"String","OwnerContactId":"00000000-0000-0000-0000-000000000000","RecordStatus":"String"}],"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}