CoreService

<back to all web services

GetActionDefinition

Action - CRUD

Returns the definition

Requires Authentication
Required role:TenantReader
The following routes are available for this service:
GET/api/actions/{Id}/definitionReturns the action definition
GET/actions/{Id}/definitionReturns the action definition
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using CoreService.ServiceModel.Dtos.Actions.Crud;
using CoreService.ServiceModel.Enums;
using CoreService.ServiceModel.Dtos.Base.Responses;

namespace CoreService.ServiceModel.Dtos.Actions.Crud
{
    ///<summary>
    ///Returns the definition
    ///</summary>
    [Api(Description="Returns the definition")]
    [ApiResponse(Description="Success", IsDefaultResponse=true, ResponseType=typeof(CoreService.ServiceModel.Dtos.Base.Responses.TemplateDefinitionDto), StatusCode=200)]
    public partial class GetActionDefinition
        : IGetSingleRequest, IHasTenantName, IGet
    {
        [ApiMember(DataType="string", Format="guid", IsRequired=true, ParameterType="path")]
        public virtual Guid Id { get; set; }

        [ApiMember(DataType="string", IsRequired=true, ParameterType="header")]
        [Validate("NotEmpty")]
        public virtual string TenantName { get; set; }

        [ApiMember(IsRequired=true, ParameterType="query")]
        public virtual TemplateLanguages DefinitionFormat { get; set; }

        ///<summary>
        ///If true, also soft deleted items will be returned
        ///</summary>
        [ApiMember(Description="If true, also soft deleted items will be returned", ParameterType="query")]
        public virtual bool? IncludeDeleted { get; set; }

        [ApiMember(ParameterType="query", Verb="GET")]
        public virtual bool? IncludeReferencedObjects { get; set; }
    }

}

namespace CoreService.ServiceModel.Dtos.Base.Responses
{
    public partial class TemplateDefinitionDto
    {
        ///<summary>
        ///The schema version of the attached definition
        ///</summary>
        public virtual int SchemaVersion { get; set; }
        ///<summary>
        ///The template definition/body either as json or yaml
        ///</summary>
        public virtual string Definition { get; set; }
    }

}

namespace CoreService.ServiceModel.Enums
{
    public enum TemplateLanguages
    {
        Json,
        Yaml,
    }

}

C# GetActionDefinition DTOs

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

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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

GET /api/actions/{Id}/definition HTTP/1.1 
Host: core.starburst.svc 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"schemaVersion":0,"definition":"String"}