Platform Subscription API

<back to all web services

SaveProject

Inserts or Updates a project details and its contact connections and addresses.

Requires Authentication
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.ServiceModelSubscription
Imports Eros.Saguna.Common.Library.ValidationEngine
Imports Eros.Saguna.Common.WebAPI.ServiceModel
Imports Eros.Saguna.Common.WebAPIModel.Models

Namespace Global

    Namespace Eros.Saguna.Common.Library.ValidationEngine

        Public Partial Class RuleValidationResult
            Public Overridable Property RuleCode As String
            Public Overridable Property Message As String
            Public Overridable Property Key As String
            Public Overridable Property Tag As String
            Public Overridable Property ErrorCode As String
        End Class

        Public Partial Class ValidationErrorList
            Public Overridable Property ValidationErrors As List(Of RuleValidationResult)
        End Class
    End Namespace

    Namespace Eros.Saguna.Common.WebAPI.ServiceModel

        Public Partial Class AddressModel
            '''<Summary>
            '''The distance between this project and another specified set of gps coordinates.
            '''</Summary>
            <ApiMember(DataType:="double", Description:="The distance between this project and another specified set of gps coordinates.", Name:="DistanceAway", ParameterType:="query")>
            Public Overridable Property DistanceAway As Double

            '''<Summary>
            '''The latitude of an address - geographic coordinates specifying the north-south position of a point on the Earth's surface.
            '''</Summary>
            <ApiMember(DataType:="Double?", Description:="The latitude of an address - geographic coordinates specifying the north-south position of a point on the Earth's surface.", IsRequired:=true, Name:="Latitude", ParameterType:="query")>
            Public Overridable Property Latitude As Double

            '''<Summary>
            '''The longitude of an address - geographic coordinates specifying the east-west position of a point on the Earth's surface.
            '''</Summary>
            <ApiMember(DataType:="Double?", Description:="The longitude of an address - geographic coordinates specifying the east-west position of a point on the Earth's surface.", IsRequired:=true, Name:="Longitude", ParameterType:="query")>
            Public Overridable Property Longitude As Double

            '''<Summary>
            '''Address Format Id Guid - this will be determined by the service.
            '''</Summary>
            <ApiMember(DataType:="Guid", Description:="Address Format Id Guid - this will be determined by the service.", Name:="AddressFormatId", ParameterType:="query")>
            Public Overridable Property AddressFormatId As Guid

            '''<Summary>
            '''Suburb Id Guid - this will attempt to be determined by the SuburbName, StateShortName and Postcode entered.
            '''</Summary>
            <ApiMember(DataType:="Guid", Description:="Suburb Id Guid - this will attempt to be determined by the SuburbName, StateShortName and Postcode entered.", Name:="SuburbId", ParameterType:="query")>
            Public Overridable Property SuburbId As Guid

            '''<Summary>
            '''The suburb name.
            '''</Summary>
            <ApiMember(DataType:="string", Description:="The suburb name.", Name:="SuburbName", ParameterType:="query")>
            Public Overridable Property SuburbName As String

            '''<Summary>
            '''The shortened State Name e.g Vic for Victoria.
            '''</Summary>
            <ApiMember(DataType:="string", Description:="The shortened State Name e.g Vic for Victoria.", Name:="StateShortName", ParameterType:="query")>
            Public Overridable Property StateShortName As String

            '''<Summary>
            '''The suburb postcode.
            '''</Summary>
            <ApiMember(DataType:="string", Description:="The suburb postcode.", Name:="PostCode", ParameterType:="query")>
            Public Overridable Property PostCode As String

            '''<Summary>
            '''Country Id Guid - this will be determined by the CountrName or ISOCountryCode entered.
            '''</Summary>
            <ApiMember(DataType:="Guid", Description:="Country Id Guid - this will be determined by the CountrName or ISOCountryCode entered.", Name:="CountryId", ParameterType:="query")>
            Public Overridable Property CountryId As Guid

            '''<Summary>
            '''the name of the country the address is within.
            '''</Summary>
            <ApiMember(DataType:="string", Description:="the name of the country the address is within.", Name:="CountryName", ParameterType:="query")>
            Public Overridable Property CountryName As String

            '''<Summary>
            '''A 2 digit ISO Country Code representing the country.
            '''</Summary>
            <ApiMember(DataType:="string", Description:="A 2 digit ISO Country Code representing the country.", Name:="ISOCountryCode", ParameterType:="query")>
            Public Overridable Property ISOCountryCode As String

            '''<Summary>
            '''The address Lot number.
            '''</Summary>
            <ApiMember(DataType:="string", Description:="The address Lot number.", Name:="LotNumber", ParameterType:="query")>
            Public Overridable Property LotNumber As String

            '''<Summary>
            '''The address Sub Unit number.
            '''</Summary>
            <ApiMember(DataType:="string", Description:="The address Sub Unit number.", Name:="SubUnit", ParameterType:="query")>
            Public Overridable Property SubUnit As String

            '''<Summary>
            '''The address building number.
            '''</Summary>
            <ApiMember(DataType:="string", Description:="The address building number.", Name:="BuildingNumber", ParameterType:="query")>
            Public Overridable Property BuildingNumber As String

            '''<Summary>
            '''The address street number.
            '''</Summary>
            <ApiMember(DataType:="string", Description:="The address street number.", Name:="StreetNumber", ParameterType:="query")>
            Public Overridable Property StreetNumber As String

            '''<Summary>
            '''The address street name including street type.
            '''</Summary>
            <ApiMember(DataType:="string", Description:="The address street name including street type.", Name:="StreetName", ParameterType:="query")>
            Public Overridable Property StreetName As String

            '''<Summary>
            '''A formatted address Line 1.
            '''</Summary>
            <ApiMember(DataType:="string", Description:="A formatted address Line 1.", Name:="AddressLineOne", ParameterType:="query")>
            Public Overridable Property AddressLineOne As String

            '''<Summary>
            '''A formatted address Line 2.
            '''</Summary>
            <ApiMember(DataType:="string", Description:="A formatted address Line 2.", Name:="AddressLineTwo", ParameterType:="query")>
            Public Overridable Property AddressLineTwo As String

            '''<Summary>
            '''The full address string.
            '''</Summary>
            <ApiMember(DataType:="string", Description:="The full address string.", Name:="AddressFull", ParameterType:="query")>
            Public Overridable Property AddressFull As String

            '''<Summary>
            '''True if the address is a physical location.
            '''</Summary>
            <ApiMember(DataType:="bool?", Description:="True if the address is a physical location.", Name:="IsPhysical", ParameterType:="query")>
            Public Overridable Property IsPhysical As Boolean?

            '''<Summary>
            '''Notes about the address.
            '''</Summary>
            <ApiMember(DataType:="string", Description:="Notes about the address.", Name:="Notes", ParameterType:="query")>
            Public Overridable Property Notes As String

            '''<Summary>
            '''If true, the address is eligible for having its coordinates calculated/updated.
            '''</Summary>
            <ApiMember(DataType:="bool?", Description:="If true, the address is eligible for having its coordinates calculated/updated.", Name:="AutoMapCoordinates", ParameterType:="query")>
            Public Overridable Property AutoMapCoordinates As Boolean?

            '''<Summary>
            '''Location Coordinates for the address.
            '''</Summary>
            <ApiMember(DataType:="LocationCoordinates", Description:="Location Coordinates for the address.", Name:="LocationCoordinates", ParameterType:="query")>
            Public Overridable Property LocationCoordinates As LocationCoordinatesModel
        End Class

        Public Partial Class LocationCoordinatesModel
            '''<Summary>
            '''The latitude of an address - geographic coordinates specifying the north-south position of a point on the Earth's surface.
            '''</Summary>
            <ApiMember(DataType:="Double?", Description:="The latitude of an address - geographic coordinates specifying the north-south position of a point on the Earth's surface.", IsRequired:=true, Name:="Latitude", ParameterType:="query")>
            Public Overridable Property Latitude As Double

            '''<Summary>
            '''The longitude of an address - geographic coordinates specifying the east-west position of a point on the Earth's surface.
            '''</Summary>
            <ApiMember(DataType:="Double?", Description:="The longitude of an address - geographic coordinates specifying the east-west position of a point on the Earth's surface.", IsRequired:=true, Name:="Longitude", ParameterType:="query")>
            Public Overridable Property Longitude As Double

            '''<Summary>
            '''The altitude of an address - the altitude above sea level.
            '''</Summary>
            <ApiMember(DataType:="Double?", Description:="The altitude of an address - the altitude above sea level.", Name:="Altitude", ParameterType:="query")>
            Public Overridable Property Altitude As Double?

            '''<Summary>
            '''Accuracy of the latitude and longitude.
            '''</Summary>
            <ApiMember(DataType:="Double?", Description:="Accuracy of the latitude and longitude.", Name:="Accuracy", ParameterType:="query")>
            Public Overridable Property Accuracy As Double?

            '''<Summary>
            '''Accurancy of the Altitude.
            '''</Summary>
            <ApiMember(DataType:="Double?", Description:="Accurancy of the Altitude.", Name:="AltitudeAccuracy", ParameterType:="query")>
            Public Overridable Property AltitudeAccuracy As Double?

            '''<Summary>
            '''Direction you are heading.
            '''</Summary>
            <ApiMember(DataType:="Double?", Description:="Direction you are heading.", Name:="Heading", ParameterType:="query")>
            Public Overridable Property Heading As Double?

            '''<Summary>
            '''Speed you are going.
            '''</Summary>
            <ApiMember(DataType:="Double?", Description:="Speed you are going.", Name:="Speed", ParameterType:="query")>
            Public Overridable Property Speed As Double?

            '''<Summary>
            '''Speed your altitude is ascending/descending at.
            '''</Summary>
            <ApiMember(DataType:="Double?", Description:="Speed your altitude is ascending/descending at.", Name:="VerticalSpeed", ParameterType:="query")>
            Public Overridable Property VerticalSpeed As Double?
        End Class

        Public Partial Class SubscriptionCommonProjectModel
            '''<Summary>
            '''A reference number used for identifying the project in the external system.
            '''</Summary>
            <ApiMember(DataType:="string", Description:="A reference number used for identifying the project in the external system.", Name:="Reference", ParameterType:="query")>
            Public Overridable Property Reference As String

            '''<Summary>
            '''A name for the project.
            '''</Summary>
            <ApiMember(DataType:="string", Description:="A name for the project.", IsRequired:=true, Name:="Name", ParameterType:="query")>
            Public Overridable Property Name As String

            '''<Summary>
            '''A description for the project.
            '''</Summary>
            <ApiMember(DataType:="string", Description:="A description for the project.", IsRequired:=true, Name:="Description", ParameterType:="query")>
            Public Overridable Property Description As String

            '''<Summary>
            '''A list of ProjectContact records that link contacts (and their role in the project) to the project.
            '''</Summary>
            <ApiMember(DataType:="List<SubscriptionLinkContact>", Description:="A list of ProjectContact records that link contacts (and their role in the project) to the project.", Name:="ProjectContacts", ParameterType:="query")>
            Public Overridable Property ProjectContacts As List(Of SubscriptionLinkContact)

            '''<Summary>
            '''An address for the project.
            '''</Summary>
            <ApiMember(DataType:="AddressModel", Description:="An address for the project.", Name:="ProjectAddress", ParameterType:="query")>
            Public Overridable Property ProjectAddress As AddressModel

            '''<Summary>
            '''A link to the Customer Contact Group.
            '''</Summary>
            <ApiMember(DataType:="SubscriptionObjectModel", Description:="A link to the Customer Contact Group.", Name:="CustomerContactGroup", ParameterType:="query")>
            Public Overridable Property CustomerContactGroup As SubscriptionObjectModel

            '''<Summary>
            '''Project Group Name.
            '''</Summary>
            <ApiMember(DataType:="string", Description:="Project Group Name.", Name:="GroupName", ParameterType:="query")>
            Public Overridable Property GroupName As String

            '''<Summary>
            '''Stage Name.
            '''</Summary>
            <ApiMember(DataType:="string", Description:="Stage Name.", Name:="StageName", ParameterType:="query")>
            Public Overridable Property StageName As String

            '''<Summary>
            '''Guid of the Media Object representing the projects primary image.
            '''</Summary>
            <ApiMember(DataType:="Guid", Description:="Guid of the Media Object representing the projects primary image.", Name:="PrimaryProjectImageId", ParameterType:="query")>
            Public Overridable Property PrimaryProjectImageId As Guid

            '''<Summary>
            '''URL to the projects primary full image.
            '''</Summary>
            <ApiMember(DataType:="string", Description:="URL to the projects primary full image.", Name:="PrimaryProjectPhotoUrl", ParameterType:="query")>
            Public Overridable Property PrimaryProjectPhotoUrl As String

            '''<Summary>
            '''URL to the projects primary thumbnail image.
            '''</Summary>
            <ApiMember(DataType:="string", Description:="URL to the projects primary thumbnail image.", Name:="PrimaryProjectThumbnailUrl", ParameterType:="query")>
            Public Overridable Property PrimaryProjectThumbnailUrl As String

            '''<Summary>
            '''Image height of the projects logo.
            '''</Summary>
            <ApiMember(DataType:="int", Description:="Image height of the projects logo.", Name:="PrimaryProjectPhotoHeight", ParameterType:="query")>
            Public Overridable Property PrimaryProjectPhotoHeight As Integer

            '''<Summary>
            '''Image height of the projects logo.
            '''</Summary>
            <ApiMember(DataType:="int", Description:="Image height of the projects logo.", Name:="PrimaryProjectPhotoWidth", ParameterType:="query")>
            Public Overridable Property PrimaryProjectPhotoWidth As Integer

            '''<Summary>
            '''Dynamically linked content.
            '''</Summary>
            <ApiMember(DataType:="string", Description:="Dynamically linked content.", Name:="DynamicContent", ParameterType:="query")>
            Public Overridable Property DynamicContent As String

            '''<Summary>
            '''If this is 'A' then a documentable ObjectConnection will be created. If this is 'D' then a documentable ObjectConnection will be removed if it exists. Any other value will be ignored.
            '''</Summary>
            <ApiMember(DataType:="char", Description:="If this is 'A' then a documentable ObjectConnection will be created. If this is 'D' then a documentable ObjectConnection will be removed if it exists. Any other value will be ignored.", Name:="DocumentableObjectConnection", ParameterType:="query")>
            Public Overridable Property DocumentableObjectConnection As Char

            '''<Summary>
            '''Dimension values linked to the project.
            '''</Summary>
            <ApiMember(DataType:="List<DimensionValueModel>", Description:="Dimension values linked to the project.", Name:="DimensionValues", ParameterType:="query")>
            Public Overridable Property DimensionValues As List(Of DimensionValueModel)

            '''<Summary>
            '''Dimension values linked to the project.
            '''</Summary>
            <ApiMember(DataType:="List<Guid>", Description:="Dimension values linked to the project.", Name:="Calendars", ParameterType:="query")>
            Public Overridable Property Calendars As List(Of Guid)

            '''<Summary>
            '''The Document Site ID.
            '''</Summary>
            <ApiMember(DataType:="Guid", Description:="The Document Site ID.", Name:="DocumentSiteId", ParameterType:="query")>
            Public Overridable Property DocumentSiteId As Guid?

            Public Overridable Property ObjectSubscriptionId As Guid
            Public Overridable Property ObjectHash As String
        End Class

        Public Partial Class SubscriptionLinkContact
            '''<Summary>
            '''Guid of the contact object within Eros.
            '''</Summary>
            <ApiMember(DataType:="Guid", Description:="Guid of the contact object within Eros.", Name:="ContactId", ParameterType:="query")>
            Public Overridable Property ContactId As Guid

            '''<Summary>
            '''The unique key that represents the contact on the external system.
            '''</Summary>
            <ApiMember(DataType:="string", Description:="The unique key that represents the contact on the external system.", IsRequired:=true, Name:="ContactAlternateKey", ParameterType:="query")>
            Public Overridable Property ContactAlternateKey As String

            '''<Summary>
            '''Guid of the Role List Item object within Eros.
            '''</Summary>
            <ApiMember(DataType:="Guid", Description:="Guid of the Role List Item object within Eros.", IsRequired:=true, Name:="RoleId", ParameterType:="query")>
            Public Overridable Property RoleId As Guid

            '''<Summary>
            '''The unique key that represents the role type on the external system. Note: Use of this is not currently implemented
            '''</Summary>
            <ApiMember(DataType:="string", Description:="The unique key that represents the role type on the external system. Note: Use of this is not currently implemented", Name:="RoleAlternateKey", ParameterType:="query")>
            Public Overridable Property RoleAlternateKey As String
        End Class

        Public Partial Class SubscriptionObjectModel
            Implements ISubscription
            '''<Summary>
            '''Guid representing the external systems datasource information.
            '''</Summary>
            <ApiMember(DataType:="Guid", Description:="Guid representing the external systems datasource information.", IsRequired:=true, Name:="SuiteDataSourceInstanceId", ParameterType:="query")>
            Public Overridable Property SuiteDataSourceInstanceId As Guid Implements ISubscription.SuiteDataSourceInstanceId

            '''<Summary>
            '''The unique key that represents the object on the external system.
            '''</Summary>
            <ApiMember(DataType:="string", Description:="The unique key that represents the object on the external system.", IsRequired:=true, Name:="AlternateKey", ParameterType:="query")>
            Public Overridable Property AlternateKey As String Implements ISubscription.AlternateKey

            '''<Summary>
            '''Guid of the object within Eros.  If ObjectId is known, the external system may pass this instead of the alternate key.
            '''</Summary>
            <ApiMember(DataType:="Guid", Description:="Guid of the object within Eros.  If ObjectId is known, the external system may pass this instead of the alternate key.", Name:="ObjectId", ParameterType:="query")>
            Public Overridable Property ObjectId As Guid Implements ISubscription.ObjectId

            '''<Summary>
            '''Guid of the RmsTableCtx within Eros.  This is used if the alternate key is provided to identify the object to update.
            '''</Summary>
            <ApiMember(DataType:="Guid", Description:="Guid of the RmsTableCtx within Eros.  This is used if the alternate key is provided to identify the object to update.", Name:="RmsTableCtxId", ParameterType:="query")>
            Public Overridable Property RmsTableCtxId As Guid

            '''<Summary>
            '''Validation ensures that this object has a value in alternateKey or ObjectId, ignoring validation skips this requirement.
            '''</Summary>
            <ApiMember(DataType:="bool", Description:="Validation ensures that this object has a value in alternateKey or ObjectId, ignoring validation skips this requirement.", Name:="IgnoreValidation", ParameterType:="query")>
            Public Overridable Property IgnoreValidation As Boolean Implements ISubscription.IgnoreValidation
        End Class
    End Namespace

    Namespace Eros.Saguna.Common.WebAPIModel.Models

        Public Partial Class DimensionValueModel
            Public Overridable Property DimensionValueId As Guid
            Public Overridable Property DimensionId As Guid
            Public Overridable Property Name As String
            Public Overridable Property Description As String
            Public Overridable Property ShortName As String
            Public Overridable Property TrafficLightId As Guid
            Public Overridable Property TrafficLightColour As String
            Public Overridable Property ObjectConnectionId As Guid
            Public Overridable Property OwnerContactId As Guid
            Public Overridable Property RecordStatus As String
        End Class
    End Namespace

    Namespace Eros.Subtle.Canvara.WebAPIModel.ServiceModelSubscription

        '''<Summary>
        '''Inserts or Updates a project details and its contact connections and addresses.
        '''</Summary>
        <Api(Description:="Inserts or Updates a project details and its contact connections and addresses.")>
        Public Partial Class SaveProject
            Inherits ValidationErrorList
            Implements ISubscription
            '''<Summary>
            '''Guid representing the external systems datasource information.
            '''</Summary>
            <ApiMember(DataType:="Guid", Description:="Guid representing the external systems datasource information.", IsRequired:=true, Name:="SuiteDataSourceInstanceId")>
            Public Overridable Property SuiteDataSourceInstanceId As Guid Implements ISubscription.SuiteDataSourceInstanceId

            '''<Summary>
            '''The unique key that represents the project on the external system.
            '''</Summary>
            <ApiMember(DataType:="string", Description:="The unique key that represents the project on the external system.", IsRequired:=true, Name:="AlternateKey")>
            Public Overridable Property AlternateKey As String Implements ISubscription.AlternateKey

            '''<Summary>
            '''Guid of the project object within Eros.  If ObjectId is known, the external system may pass this instead of the alternate key.
            '''</Summary>
            <ApiMember(DataType:="Guid", Description:="Guid of the project object within Eros.  If ObjectId is known, the external system may pass this instead of the alternate key.", Name:="ObjectId", ParameterType:="query")>
            Public Overridable Property ObjectId As Guid Implements ISubscription.ObjectId

            '''<Summary>
            '''If set to true, the object will be updated/refreshed. If false, the hash representation of the Project model and its data will be compared with the current Project to determine if there are any changes to save.
            '''</Summary>
            <ApiMember(DataType:="bool", Description:="If set to true, the object will be updated/refreshed. If false, the hash representation of the Project model and its data will be compared with the current Project to determine if there are any changes to save.", Name:="IgnoreHash")>
            Public Overridable Property IgnoreHash As Boolean

            Public Overridable Property IgnoreValidation As Boolean Implements ISubscription.IgnoreValidation
            '''<Summary>
            '''Object containing all details of the project to be inserted or updated.
            '''</Summary>
            <ApiMember(DataType:="SubscriptionCommonProjectModel", Description:="Object containing all details of the project to be inserted or updated.", IsRequired:=true, Name:="Project", ParameterType:="query")>
            Public Overridable Property Project As SubscriptionCommonProjectModel

            Public Overridable Property LicenseeId As Guid
            Public Overridable Property SessionId As Guid
        End Class
    End Namespace
End Namespace

VB.NET SaveProject DTOs

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

HTTP + OTHER

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

POST /jsonl/reply/SaveProject HTTP/1.1 
Host: production-eros-platform-apisubscription.azurewebsites.net 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"AlternateKey":"String","IgnoreHash":false,"IgnoreValidation":false,"Project":{"Reference":"String","Name":"String","Description":"String","ProjectContacts":[{"ContactAlternateKey":"String","RoleAlternateKey":"String"}],"ProjectAddress":{"DistanceAway":0,"Latitude":0,"Longitude":0,"SuburbName":"String","StateShortName":"String","PostCode":"String","CountryName":"String","ISOCountryCode":"String","LotNumber":"String","SubUnit":"String","BuildingNumber":"String","StreetNumber":"String","StreetName":"String","AddressLineOne":"String","AddressLineTwo":"String","AddressFull":"String","IsPhysical":false,"Notes":"String","AutoMapCoordinates":false,"LocationCoordinates":{"Latitude":0,"Longitude":0,"Altitude":0,"Accuracy":0,"AltitudeAccuracy":0,"Heading":0,"Speed":0,"VerticalSpeed":0}},"CustomerContactGroup":{"AlternateKey":"String","IgnoreValidation":false},"GroupName":"String","StageName":"String","PrimaryProjectPhotoUrl":"String","PrimaryProjectThumbnailUrl":"String","PrimaryProjectPhotoHeight":0,"PrimaryProjectPhotoWidth":0,"DynamicContent":"String","DocumentableObjectConnection":"\u0000","DimensionValues":[{"Name":"String","Description":"String","ShortName":"String","TrafficLightColour":"String","RecordStatus":"String"}],"Calendars":["00000000-0000-0000-0000-000000000000"],"DocumentSiteId":"00000000-0000-0000-0000-000000000000","ObjectHash":"String"},"ValidationErrors":[{"RuleCode":"String","Message":"String","Key":"String","Tag":"String","ErrorCode":"String"}]}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}