| GET | /v4/links | ||
|---|---|---|---|
| GET | /v4/links/{Id} |
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using ShortlinksAPI.ServiceModel.V4.Requests;
using ShortlinksAPI.ServiceModel.V4.Responses;
using ShortlinksAPI.Contracts.V4.DTOs;
using Geniuslink.Shortlinks.Constants;
using Geniuslink.Shortlinks;
namespace Geniuslink.Shortlinks
{
public partial class RefreshableMetadata
: IRefreshableMetadata
{
public virtual DateTime CreatedDate { get; set; }
public virtual DateTime UpdatedDate { get; set; }
}
public partial class VersionedRefreshableMetadata
: RefreshableMetadata
{
public virtual DateTime VersionCreatedDate { get; set; }
}
}
namespace Geniuslink.Shortlinks.Constants
{
public enum LinkType
{
None,
Simple,
Split,
Interstitial,
Advanced,
Collection,
}
}
namespace ShortlinksAPI.Contracts.V4.DTOs
{
public partial interface IUserLink
{
string Url { get; set; }
string BaseCode { get; set; }
LinkType LinkType { get; set; }
string TypeDefinitionPublicId { get; set; }
VersionedRefreshableMetadata Metadata { get; set; }
}
}
namespace ShortlinksAPI.ServiceModel.V4.Requests
{
[DataContract]
public partial class GetUserLinkRequest
: V4BaseRequest
{
[DataMember(Name="id")]
public virtual string Id { get; set; }
[DataMember(Name="username")]
public virtual string Username { get; set; }
[DataMember(Name="groupId")]
public virtual uint GroupId { get; set; }
}
[DataContract]
public partial class V4BaseRequest
{
}
}
namespace ShortlinksAPI.ServiceModel.V4.Responses
{
[DataContract]
public partial class GetUserLinkResponse
: V4BaseResponse, IGetUserLinkResponse
{
[DataMember(Name="data")]
public virtual IUserLink Data { get; set; }
}
[DataContract]
public partial class V4BaseResponse
{
[DataMember(Name="status")]
public virtual ResponseStatus ResponseStatus { get; set; }
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /v4/links HTTP/1.1 Host: shortlinks-api.qa.platform.georiot.com Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
status:
{
errorCode: String,
message: String,
stackTrace: String,
errors:
[
{
errorCode: String,
fieldName: String,
message: String,
meta:
{
String: String
}
}
],
meta:
{
String: String
}
}
}