Hide menu Last updated: Oct 20 2016
Area: Episerver Service API Applies to versions: 2 and higher Previous versions: Not applicable

Content RESTful operations

This topic describes how to work with content RESTful operations, identity mapping and content identifiers in the Episerver service API.

Table of contents

Example models

C#
[Serializable]
    public class IdentityMapping
    {
        public string IntegrationId { get; set; }
        public DateTime? Modified { get; set; }
        public string ProviderName { get; set; }
    }

Get Identities 
/episerverapi/commerce/identities/{providerName=default}

This method gets all the content created integration identifiers with the provider name specified. If none is specified, default is the default parameter.

Client Code Media Type Json

C#
var client = new HttpClient()
{
	BaseAddress = new Uri(ConfigurationManager.AppSettings["integrationUrl"])
};
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.AccessToken);		
var result = client.GetAsync("/episerverapi/commerce/identities/{providerName=default}").Result.Content.ReadAsStringAsync().Result

Response Json

Json
[
    {
        "IntegrationId": "02ce51ec-da5c-483e-a6a7-156904ef2e80",
        "Modified": "2015-02-10T17:11:53.477",
        "ProviderName": "default"
    },
    {
        "IntegrationId": "0a0862a3-5b84-4c13-bd9d-f91f05e7bd6a",
        "Modified": "2015-02-10T17:11:35.013",
        "ProviderName": "default"
    },
    {
        "IntegrationId": "0a507d7f-f31d-4559-aac0-3699851c4577",
        "Modified": "2015-02-10T17:11:33.983",
        "ProviderName": "default"
    },
    {
        "IntegrationId": "12778f61-c87d-46fa-8778-adbc6c238e1d",
        "Modified": "2015-02-10T17:11:52.803",
        "ProviderName": "default"
    },
    {
        "IntegrationId": "13b45549-d9c4-48b6-b9f1-d7825f98786b",
        "Modified": "2015-02-10T17:11:48.263",
        "ProviderName": "default"
    },
    {
        "IntegrationId": "15780210-df2e-4454-a218-a20ddd5e6ebd",
        "Modified": "2015-02-10T17:11:47.763",
        "ProviderName": "default"
    },
    {
        "IntegrationId": "19b0ecd9-fc69-4ef8-a45b-1c2e9b1b52c1",
        "Modified": "2015-02-10T17:11:41.843",
        "ProviderName": "default"
    },
    {
        "IntegrationId": "1c1a773b-7b9c-4ecd-9f64-b558aff74a10",
        "Modified": "2015-02-10T17:11:20.287",
        "ProviderName": "default"
    },
    {
        "IntegrationId": "1c218f42-6c30-461a-93d4-e09b7790ad58",
        "Modified": "2015-02-10T17:11:56.263",
        "ProviderName": "default"
    }
]

Client Code Media Type XML

C#
var client = new HttpClient()
{
	BaseAddress = new Uri(ConfigurationManager.AppSettings["integrationUrl"])
};
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.AccessToken);
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("text/xml"));		
var result = client.GetAsync("/episerverapi/commerce/identities/{providerName=default}").Result.Content.ReadAsStringAsync().Result

Response XML

XML
<ArrayOfIdentityMapping 
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <IdentityMapping>
        <IntegrationId>02ce51ec-da5c-483e-a6a7-156904ef2e80</IntegrationId>
        <Modified>2015-02-10T17:11:53.477</Modified>
        <ProviderName>default</ProviderName>
    </IdentityMapping>
    <IdentityMapping>
        <IntegrationId>0a0862a3-5b84-4c13-bd9d-f91f05e7bd6a</IntegrationId>
        <Modified>2015-02-10T17:11:35.013</Modified>
        <ProviderName>default</ProviderName>
    </IdentityMapping>
    <IdentityMapping>
        <IntegrationId>0a507d7f-f31d-4559-aac0-3699851c4577</IntegrationId>
        <Modified>2015-02-10T17:11:33.983</Modified>
        <ProviderName>default</ProviderName>
    </IdentityMapping>
    <IdentityMapping>
        <IntegrationId>12778f61-c87d-46fa-8778-adbc6c238e1d</IntegrationId>
        <Modified>2015-02-10T17:11:52.803</Modified>
        <ProviderName>default</ProviderName>
    </IdentityMapping>
    <IdentityMapping>
        <IntegrationId>13b45549-d9c4-48b6-b9f1-d7825f98786b</IntegrationId>
        <Modified>2015-02-10T17:11:48.263</Modified>
        <ProviderName>default</ProviderName>
    </IdentityMapping>
    <IdentityMapping>
        <IntegrationId>15780210-df2e-4454-a218-a20ddd5e6ebd</IntegrationId>
        <Modified>2015-02-10T17:11:47.763</Modified>
        <ProviderName>default</ProviderName>
    </IdentityMapping>
    <IdentityMapping>
        <IntegrationId>19b0ecd9-fc69-4ef8-a45b-1c2e9b1b52c1</IntegrationId>
        <Modified>2015-02-10T17:11:41.843</Modified>
        <ProviderName>default</ProviderName>
    </IdentityMapping>
    <IdentityMapping>
        <IntegrationId>1c1a773b-7b9c-4ecd-9f64-b558aff74a10</IntegrationId>
        <Modified>2015-02-10T17:11:20.287</Modified>
        <ProviderName>default</ProviderName>
    </IdentityMapping>
</ArrayOfIdentityMapping>

 

Comments