GET | /subs |
---|
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using MigrantLeap.PortalBackend.Models;
using MigrantLeap.PortalBackend.Providers.Models;
namespace MigrantLeap.PortalBackend.Models
{
public partial class SubsRequest
{
public virtual string Lang { get; set; }
}
public partial class SubsResponse
{
public SubsResponse()
{
Subscriptions = new List<MSubscription>{};
}
public virtual List<MSubscription> Subscriptions { get; set; }
public virtual int ResponseCode { get; set; }
public virtual string ResponseMessage { get; set; }
}
}
namespace MigrantLeap.PortalBackend.Providers.Models
{
public partial class MBenefit
{
public MBenefit()
{
SubBenefits = new List<MSubBenefit>{};
}
public virtual long Id { get; set; }
public virtual string Name { get; set; }
public virtual bool Status { get; set; }
public virtual int Order { get; set; }
public virtual string Image { get; set; }
public virtual List<MSubBenefit> SubBenefits { get; set; }
}
public partial class MSubBenefit
{
public virtual long Id { get; set; }
public virtual string Name { get; set; }
public virtual bool Status { get; set; }
public virtual int Order { get; set; }
public virtual bool HasContent { get; set; }
public virtual string Image { get; set; }
public virtual string RSSHash { get; set; }
}
public partial class MSubscription
{
public MSubscription()
{
Benefits = new List<MBenefit>{};
}
public virtual long Id { get; set; }
public virtual string Name { get; set; }
public virtual string Description { get; set; }
public virtual bool Status { get; set; }
public virtual decimal YearlyPrice { get; set; }
public virtual decimal Price { get; set; }
public virtual int Order { get; set; }
public virtual string Icon { get; set; }
public virtual string PaymentLink { get; set; }
public virtual string YearlyPaymentLink { get; set; }
public virtual string Sid { get; set; }
public virtual string YearlySid { get; set; }
public virtual decimal Discount { get; set; }
public virtual List<MBenefit> Benefits { get; set; }
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /subs HTTP/1.1 Host: portal-api.migrantleap.com Accept: text/csv
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {"subscriptions":[{"id":0,"name":"String","description":"String","status":false,"yearlyPrice":0,"price":0,"order":0,"icon":"String","paymentLink":"String","yearlyPaymentLink":"String","sid":"String","yearlySid":"String","discount":0,"benefits":[{"id":0,"name":"String","status":false,"order":0,"image":"String","subBenefits":[{"id":0,"name":"String","status":false,"order":0,"hasContent":false,"image":"String","rssHash":"String"}]}]}],"responseCode":0,"responseMessage":"String"}