ServiceStack Home (Live)

<back to all web services

CreateOpenSourceLicense

The following routes are available for this service:
POST/freelicense/opensource
POST/CreateOpenSourceLicense
import Foundation
import ServiceStack

public class CreateOpenSourceLicense : IPost, Codable
{
    public var licenseName:String
    public var projectUrl:String
    public var licenseSpdx:String
    public var agreeTerms:Bool

    required public init(){}
}

public class FreeLicenseResponse : Codable
{
    public var licenseName:String
    public var licenseRef:String
    public var licenseKey:String
    public var licenseType:LicenseType?
    public var createdDate:Date?
    public var expiryDate:Date?
    public var externalRef:String
    public var responseStatus:ResponseStatus

    required public init(){}
}

public enum LicenseType : String, Codable
{
    case Free
    case FreeIndividual
    case FreeOpenSource
    case Indie
    case Business
    case Enterprise
    case TextIndie
    case TextBusiness
    case OrmLiteIndie
    case OrmLiteBusiness
    case RedisIndie
    case RedisBusiness
    case AwsIndie
    case AwsBusiness
    case Trial
    case Site
    case TextSite
    case RedisSite
    case OrmLiteSite
}


Swift CreateOpenSourceLicense 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.

POST /freelicense/opensource HTTP/1.1 
Host: account.servicestack.net 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"licenseName":"String","projectUrl":"String","licenseSpdx":"String","agreeTerms":false}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"licenseName":"String","licenseRef":"String","licenseKey":"String","licenseType":"Free","createdDate":"\/Date(-62135596800000-0000)\/","expiryDate":"\/Date(-62135596800000-0000)\/","externalRef":"String","responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}