<back to all web services

RelationChangeMessage

The following routes are available for this service:
PUT/RestApi/sitefinity/related-data/relations
import Foundation
import ServiceStack

public class RelationChangeMessage : Codable
{
    public var itemId:String
    public var itemType:String
    public var itemProvider:String
    public var relationChanges:[ContentLinkChange] = []

    required public init(){}
}

// @DataContract
public class ContentLinkChange : Codable
{
    // @DataMember
    public var state:ContentLinkChangeState

    // @DataMember
    public var childItemId:String

    // @DataMember
    public var childItemProviderName:String

    // @DataMember
    public var childItemType:String

    // @DataMember
    public var childItemAdditionalInfo:String

    // @DataMember
    public var ordinal:Float?

    // @DataMember
    public var componentPropertyName:String

    required public init(){}
}

// @DataContract
public enum ContentLinkChangeState : String, Codable
{
    case Added
    case Removed
    case Updated
}


Swift RelationChangeMessage DTOs

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

HTTP + JSV

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

PUT /RestApi/sitefinity/related-data/relations HTTP/1.1 
Host: www.asg.com.au 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	ItemId: String,
	ItemType: String,
	ItemProvider: String,
	RelationChanges: 
	[
		{
			State: Added,
			ChildItemProviderName: String,
			ChildItemType: String,
			ChildItemAdditionalInfo: String,
			Ordinal: 0,
			ComponentPropertyName: String,
			IsChildDeleted: False
		}
	]
}