Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

Get Url Of Entry From API

Vote:
 

Hi Everyone,

I'm currently able to return an entry from the API however, I don't see anyway to get the full url without getting the parent product/nodes to build the url which wouldn't be efficient.

Here's my code so far.

                if (_token == null || !_token.IsExpired()) _token = GetToken(this.ApiConfig.Username, this.ApiConfig.Password);
                using (var client = new HttpClient() { BaseAddress = new Uri(this.ApiConfig.URL) })
                {

                    client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", _token.AccessToken);

                    HttpResponseMessage response = client.GetAsync(String.Format($"/episerverapi/commerce/entries/{entryCode}", entryCode)).Result;
                    if (response.StatusCode == HttpStatusCode.OK)
                    {
                        using (StreamReader reader = new StreamReader(response.Content.ReadAsStreamAsync().Result))
                        {
                            var json = reader.ReadToEnd();
                            ce = JsonConvert.DeserializeObject(json);
                        }
                    }
                }

I'm using the models right out of the github api sample located here: https://github.com/episerver/ServiceApi-Client/tree/master/EPiServer.ServiceApi.Client/Models/Catalog.

The, API call to '/episerverapi/commerce/entries/{entryCode}' returns this json.

{  
   "Code":"32452",
   "ApplicationId":"e14675f9-a54b-40bd-a9a1-ccf63e5dd6dd",
   "Name":"11.5mm Dia x 20mm FL, Grade 1, Achromatic Lens",
   "StartDate":"2016-07-08T04:00:00Z",
   "EndDate":"2026-07-19T19:48:24.85Z",
   "IsActive":true,
   "MetaClass":"Part Number",
   "Catalog":"EdmundOptics",
   "MetaFields":[  
      {  
         "Name":"AdditionalDetail",
         "Type":"LongHtmlString",
         "Data":[  
            {  
               "Language":"de",
               "Value":""
            },
            {  
               "Language":"en",
               "Value":""
            },
            {  
               "Language":"en-au",
               "Value":""
            },
            {  
               "Language":"en-gb",
               "Value":""
            },
            {  
               "Language":"en-ie",
               "Value":""
            },
            {  
               "Language":"en-sg",
               "Value":""
            },
            {  
               "Language":"es-es",
               "Value":""
            },
            {  
               "Language":"es-mx",
               "Value":""
            },
            {  
               "Language":"fr",
               "Value":""
            },
            {  
               "Language":"ja-jp",
               "Value":""
            },
            {  
               "Language":"ko-kr",
               "Value":""
            },
            {  
               "Language":"zh-cn",
               "Value":""
            },
            {  
               "Language":"zh-tw",
               "Value":""
            }
         ]
      },
      {  
         "Name":"ceCertified",
         "Type":"Boolean",
         "Data":[  
            {  
               "Language":"de",
               "Value":""
            },
            {  
               "Language":"en",
               "Value":""
            },
            {  
               "Language":"en-au",
               "Value":""
            },
            {  
               "Language":"en-gb",
               "Value":""
            },
            {  
               "Language":"en-ie",
               "Value":""
            },
            {  
               "Language":"en-sg",
               "Value":""
            },
            {  
               "Language":"es-es",
               "Value":""
            },
            {  
               "Language":"es-mx",
               "Value":""
            },
            {  
               "Language":"fr",
               "Value":""
            },
            {  
               "Language":"ja-jp",
               "Value":""
            },
            {  
               "Language":"ko-kr",
               "Value":""
            },
            {  
               "Language":"zh-cn",
               "Value":""
            },
            {  
               "Language":"zh-tw",
               "Value":""
            }
         ]
      },
      {  
         "Name":"DisplayName",
         "Type":"ShortString",
         "Data":[  
            {  
               "Language":"de",
               "Value":""
            },
            {  
               "Language":"en",
               "Value":"11.5mm Dia x 20mm FL, Grade 1, Achromatic Lens"
            },
            {  
               "Language":"en-au",
               "Value":""
            },
            {  
               "Language":"en-gb",
               "Value":""
            },
            {  
               "Language":"en-ie",
               "Value":""
            },
            {  
               "Language":"en-sg",
               "Value":""
            },
            {  
               "Language":"es-es",
               "Value":""
            },
            {  
               "Language":"es-mx",
               "Value":""
            },
            {  
               "Language":"fr",
               "Value":""
            },
            {  
               "Language":"ja-jp",
               "Value":""
            },
            {  
               "Language":"ko-kr",
               "Value":""
            },
            {  
               "Language":"zh-cn",
               "Value":""
            },
            {  
               "Language":"zh-tw",
               "Value":""
            }
         ]
      },
      {  
         "Name":"Epi_IsPublished",
         "Type":"Boolean",
         "Data":[  
            {  
               "Language":"de",
               "Value":""
            },
            {  
               "Language":"en",
               "Value":"True"
            },
            {  
               "Language":"en-au",
               "Value":""
            },
            {  
               "Language":"en-gb",
               "Value":""
            },
            {  
               "Language":"en-ie",
               "Value":""
            },
            {  
               "Language":"en-sg",
               "Value":""
            },
            {  
               "Language":"es-es",
               "Value":""
            },
            {  
               "Language":"es-mx",
               "Value":""
            },
            {  
               "Language":"fr",
               "Value":""
            },
            {  
               "Language":"ja-jp",
               "Value":""
            },
            {  
               "Language":"ko-kr",
               "Value":""
            },
            {  
               "Language":"zh-cn",
               "Value":""
            },
            {  
               "Language":"zh-tw",
               "Value":""
            }
         ]
      },
      {  
         "Name":"Epi_StartPublish",
         "Type":"DateTime",
         "Data":[  
            {  
               "Language":"de",
               "Value":""
            },
            {  
               "Language":"en",
               "Value":"7/8/2016 4:00:00 AM"
            },
            {  
               "Language":"en-au",
               "Value":""
            },
            {  
               "Language":"en-gb",
               "Value":""
            },
            {  
               "Language":"en-ie",
               "Value":""
            },
            {  
               "Language":"en-sg",
               "Value":""
            },
            {  
               "Language":"es-es",
               "Value":""
            },
            {  
               "Language":"es-mx",
               "Value":""
            },
            {  
               "Language":"fr",
               "Value":""
            },
            {  
               "Language":"ja-jp",
               "Value":""
            },
            {  
               "Language":"ko-kr",
               "Value":""
            },
            {  
               "Language":"zh-cn",
               "Value":""
            },
            {  
               "Language":"zh-tw",
               "Value":""
            }
         ]
      },
      {  
         "Name":"Epi_StopPublish",
         "Type":"DateTime",
         "Data":[  
            {  
               "Language":"de",
               "Value":""
            },
            {  
               "Language":"en",
               "Value":"7/19/2026 7:48:24 PM"
            },
            {  
               "Language":"en-au",
               "Value":""
            },
            {  
               "Language":"en-gb",
               "Value":""
            },
            {  
               "Language":"en-ie",
               "Value":""
            },
            {  
               "Language":"en-sg",
               "Value":""
            },
            {  
               "Language":"es-es",
               "Value":""
            },
            {  
               "Language":"es-mx",
               "Value":""
            },
            {  
               "Language":"fr",
               "Value":""
            },
            {  
               "Language":"ja-jp",
               "Value":""
            },
            {  
               "Language":"ko-kr",
               "Value":""
            },
            {  
               "Language":"zh-cn",
               "Value":""
            },
            {  
               "Language":"zh-tw",
               "Value":""
            }
         ]
      },
      {  
         "Name":"groupCode",
         "Type":"LongString",
         "Data":[  
            {  
               "Language":"de",
               "Value":"OPL  A"
            },
            {  
               "Language":"en",
               "Value":"OPL  A"
            },
            {  
               "Language":"en-au",
               "Value":"OPL  A"
            },
            {  
               "Language":"en-gb",
               "Value":"OPL  A"
            },
            {  
               "Language":"en-ie",
               "Value":"OPL  A"
            },
            {  
               "Language":"en-sg",
               "Value":"OPL  A"
            },
            {  
               "Language":"es-es",
               "Value":"OPL  A"
            },
            {  
               "Language":"es-mx",
               "Value":"OPL  A"
            },
            {  
               "Language":"fr",
               "Value":"OPL  A"
            },
            {  
               "Language":"ja-jp",
               "Value":"OPL  A"
            },
            {  
               "Language":"ko-kr",
               "Value":"OPL  A"
            },
            {  
               "Language":"zh-cn",
               "Value":"OPL  A"
            },
            {  
               "Language":"zh-tw",
               "Value":"OPL  A"
            }
         ]
      },
      {  
         "Name":"hazmat",
         "Type":"Boolean",
         "Data":[  
            {  
               "Language":"de",
               "Value":""
            },
            {  
               "Language":"en",
               "Value":""
            },
            {  
               "Language":"en-au",
               "Value":""
            },
            {  
               "Language":"en-gb",
               "Value":""
            },
            {  
               "Language":"en-ie",
               "Value":""
            },
            {  
               "Language":"en-sg",
               "Value":""
            },
            {  
               "Language":"es-es",
               "Value":""
            },
            {  
               "Language":"es-mx",
               "Value":""
            },
            {  
               "Language":"fr",
               "Value":""
            },
            {  
               "Language":"ja-jp",
               "Value":""
            },
            {  
               "Language":"ko-kr",
               "Value":""
            },
            {  
               "Language":"zh-cn",
               "Value":""
            },
            {  
               "Language":"zh-tw",
               "Value":""
            }
         ]
      },
      {  
         "Name":"InternalNotes",
         "Type":"LongHtmlString",
         "Data":[  
            {  
               "Language":"de",
               "Value":""
            },
            {  
               "Language":"en",
               "Value":""
            },
            {  
               "Language":"en-au",
               "Value":""
            },
            {  
               "Language":"en-gb",
               "Value":""
            },
            {  
               "Language":"en-ie",
               "Value":""
            },
            {  
               "Language":"en-sg",
               "Value":""
            },
            {  
               "Language":"es-es",
               "Value":""
            },
            {  
               "Language":"es-mx",
               "Value":""
            },
            {  
               "Language":"fr",
               "Value":""
            },
            {  
               "Language":"ja-jp",
               "Value":""
            },
            {  
               "Language":"ko-kr",
               "Value":""
            },
            {  
               "Language":"zh-cn",
               "Value":""
            },
            {  
               "Language":"zh-tw",
               "Value":""
            }
         ]
      },
      {  
         "Name":"isAccessory",
         "Type":"Boolean",
         "Data":[  
            {  
               "Language":"de",
               "Value":"True"
            },
            {  
               "Language":"en",
               "Value":"True"
            },
            {  
               "Language":"en-au",
               "Value":"True"
            },
            {  
               "Language":"en-gb",
               "Value":"True"
            },
            {  
               "Language":"en-ie",
               "Value":"True"
            },
            {  
               "Language":"en-sg",
               "Value":"True"
            },
            {  
               "Language":"es-es",
               "Value":"True"
            },
            {  
               "Language":"es-mx",
               "Value":"True"
            },
            {  
               "Language":"fr",
               "Value":"True"
            },
            {  
               "Language":"ja-jp",
               "Value":"True"
            },
            {  
               "Language":"ko-kr",
               "Value":"True"
            },
            {  
               "Language":"zh-cn",
               "Value":"True"
            },
            {  
               "Language":"zh-tw",
               "Value":"True"
            }
         ]
      },
      {  
         "Name":"itemClassId",
         "Type":"Integer",
         "Data":[  
            {  
               "Language":"de",
               "Value":""
            },
            {  
               "Language":"en",
               "Value":""
            },
            {  
               "Language":"en-au",
               "Value":""
            },
            {  
               "Language":"en-gb",
               "Value":""
            },
            {  
               "Language":"en-ie",
               "Value":""
            },
            {  
               "Language":"en-sg",
               "Value":""
            },
            {  
               "Language":"es-es",
               "Value":""
            },
            {  
               "Language":"es-mx",
               "Value":""
            },
            {  
               "Language":"fr",
               "Value":""
            },
            {  
               "Language":"ja-jp",
               "Value":""
            },
            {  
               "Language":"ko-kr",
               "Value":""
            },
            {  
               "Language":"zh-cn",
               "Value":""
            },
            {  
               "Language":"zh-tw",
               "Value":""
            }
         ]
      },
      {  
         "Name":"newItemClassDate",
         "Type":"DateTime",
         "Data":[  
            {  
               "Language":"de",
               "Value":""
            },
            {  
               "Language":"en",
               "Value":""
            },
            {  
               "Language":"en-au",
               "Value":""
            },
            {  
               "Language":"en-gb",
               "Value":""
            },
            {  
               "Language":"en-ie",
               "Value":""
            },
            {  
               "Language":"en-sg",
               "Value":""
            },
            {  
               "Language":"es-es",
               "Value":""
            },
            {  
               "Language":"es-mx",
               "Value":""
            },
            {  
               "Language":"fr",
               "Value":""
            },
            {  
               "Language":"ja-jp",
               "Value":""
            },
            {  
               "Language":"ko-kr",
               "Value":""
            },
            {  
               "Language":"zh-cn",
               "Value":""
            },
            {  
               "Language":"zh-tw",
               "Value":""
            }
         ]
      },
      {  
         "Name":"oversized",
         "Type":"Boolean",
         "Data":[  
            {  
               "Language":"de",
               "Value":""
            },
            {  
               "Language":"en",
               "Value":""
            },
            {  
               "Language":"en-au",
               "Value":""
            },
            {  
               "Language":"en-gb",
               "Value":""
            },
            {  
               "Language":"en-ie",
               "Value":""
            },
            {  
               "Language":"en-sg",
               "Value":""
            },
            {  
               "Language":"es-es",
               "Value":""
            },
            {  
               "Language":"es-mx",
               "Value":""
            },
            {  
               "Language":"fr",
               "Value":""
            },
            {  
               "Language":"ja-jp",
               "Value":""
            },
            {  
               "Language":"ko-kr",
               "Value":""
            },
            {  
               "Language":"zh-cn",
               "Value":""
            },
            {  
               "Language":"zh-tw",
               "Value":""
            }
         ]
      },
      {  
         "Name":"partNumber",
         "Type":"LongString",
         "Data":[  
            {  
               "Language":"de",
               "Value":"32-452"
            },
            {  
               "Language":"en",
               "Value":"32-452"
            },
            {  
               "Language":"en-au",
               "Value":"32-452"
            },
            {  
               "Language":"en-gb",
               "Value":"32-452"
            },
            {  
               "Language":"en-ie",
               "Value":"32-452"
            },
            {  
               "Language":"en-sg",
               "Value":"32-452"
            },
            {  
               "Language":"es-es",
               "Value":"32-452"
            },
            {  
               "Language":"es-mx",
               "Value":"32-452"
            },
            {  
               "Language":"fr",
               "Value":"32-452"
            },
            {  
               "Language":"ja-jp",
               "Value":"32-452"
            },
            {  
               "Language":"ko-kr",
               "Value":"32-452"
            },
            {  
               "Language":"zh-cn",
               "Value":"32-452"
            },
            {  
               "Language":"zh-tw",
               "Value":"32-452"
            }
         ]
      },
      {  
         "Name":"partNumberDescription",
         "Type":"LongString",
         "Data":[  
            {  
               "Language":"de",
               "Value":""
            },
            {  
               "Language":"en",
               "Value":"11.5mm Dia x 20mm FL, Grade 1, Achromatic Lens"
            },
            {  
               "Language":"en-au",
               "Value":""
            },
            {  
               "Language":"en-gb",
               "Value":""
            },
            {  
               "Language":"en-ie",
               "Value":""
            },
            {  
               "Language":"en-sg",
               "Value":""
            },
            {  
               "Language":"es-es",
               "Value":""
            },
            {  
               "Language":"es-mx",
               "Value":""
            },
            {  
               "Language":"fr",
               "Value":""
            },
            {  
               "Language":"ja-jp",
               "Value":""
            },
            {  
               "Language":"ko-kr",
               "Value":""
            },
            {  
               "Language":"zh-cn",
               "Value":""
            },
            {  
               "Language":"zh-tw",
               "Value":""
            }
         ]
      },
      {  
         "Name":"productClass",
         "Type":"LongString",
         "Data":[  
            {  
               "Language":"de",
               "Value":""
            },
            {  
               "Language":"en",
               "Value":""
            },
            {  
               "Language":"en-au",
               "Value":""
            },
            {  
               "Language":"en-gb",
               "Value":""
            },
            {  
               "Language":"en-ie",
               "Value":""
            },
            {  
               "Language":"en-sg",
               "Value":""
            },
            {  
               "Language":"es-es",
               "Value":""
            },
            {  
               "Language":"es-mx",
               "Value":""
            },
            {  
               "Language":"fr",
               "Value":""
            },
            {  
               "Language":"ja-jp",
               "Value":""
            },
            {  
               "Language":"ko-kr",
               "Value":""
            },
            {  
               "Language":"zh-cn",
               "Value":""
            },
            {  
               "Language":"zh-tw",
               "Value":""
            }
         ]
      },
      {  
         "Name":"ProductSchema",
         "Type":"Integer",
         "Data":[  
            {  
               "Language":"de",
               "Value":""
            },
            {  
               "Language":"en",
               "Value":""
            },
            {  
               "Language":"en-au",
               "Value":""
            },
            {  
               "Language":"en-gb",
               "Value":""
            },
            {  
               "Language":"en-ie",
               "Value":""
            },
            {  
               "Language":"en-sg",
               "Value":""
            },
            {  
               "Language":"es-es",
               "Value":""
            },
            {  
               "Language":"es-mx",
               "Value":""
            },
            {  
               "Language":"fr",
               "Value":""
            },
            {  
               "Language":"ja-jp",
               "Value":""
            },
            {  
               "Language":"ko-kr",
               "Value":""
            },
            {  
               "Language":"zh-cn",
               "Value":""
            },
            {  
               "Language":"zh-tw",
               "Value":""
            }
         ]
      },
      {  
         "Name":"rohsStatus",
         "Type":"LongString",
         "Data":[  
            {  
               "Language":"de",
               "Value":""
            },
            {  
               "Language":"en",
               "Value":""
            },
            {  
               "Language":"en-au",
               "Value":""
            },
            {  
               "Language":"en-gb",
               "Value":""
            },
            {  
               "Language":"en-ie",
               "Value":""
            },
            {  
               "Language":"en-sg",
               "Value":""
            },
            {  
               "Language":"es-es",
               "Value":""
            },
            {  
               "Language":"es-mx",
               "Value":""
            },
            {  
               "Language":"fr",
               "Value":""
            },
            {  
               "Language":"ja-jp",
               "Value":""
            },
            {  
               "Language":"ko-kr",
               "Value":""
            },
            {  
               "Language":"zh-cn",
               "Value":""
            },
            {  
               "Language":"zh-tw",
               "Value":""
            }
         ]
      },
      {  
         "Name":"Specifications",
         "Type":"LongString",
         "Data":[  
            {  
               "Language":"de",
               "Value":""
            },
            {  
               "Language":"en",
               "Value":""
            },
            {  
               "Language":"en-au",
               "Value":""
            },
            {  
               "Language":"en-gb",
               "Value":""
            },
            {  
               "Language":"en-ie",
               "Value":""
            },
            {  
               "Language":"en-sg",
               "Value":""
            },
            {  
               "Language":"es-es",
               "Value":""
            },
            {  
               "Language":"es-mx",
               "Value":""
            },
            {  
               "Language":"fr",
               "Value":""
            },
            {  
               "Language":"ja-jp",
               "Value":""
            },
            {  
               "Language":"ko-kr",
               "Value":""
            },
            {  
               "Language":"zh-cn",
               "Value":""
            },
            {  
               "Language":"zh-tw",
               "Value":""
            }
         ]
      }
   ],
   "SeoInformation":[  
      {  
         "Title":"",
         "Uri":"115mm-Dia-x-20mm-FL-Grade-1-Achromatic-Lens-de.aspx",
         "UriSegment":"11.5mm-dia-x-20mm-fl-grade-1-achromatic-lens",
         "Description":"",
         "Keywords":"",
         "LanguageCode":"de"
      },
      {  
         "Title":"",
         "Uri":"115mm-Dia-x-20mm-FL-Grade-1-Achromatic-Lens-en-au.aspx",
         "UriSegment":"11.5mm-dia-x-20mm-fl-grade-1-achromatic-lens",
         "Description":"",
         "Keywords":"",
         "LanguageCode":"en-au"
      },
      {  
         "Title":"",
         "Uri":"115mm-Dia-x-20mm-FL-Grade-1-Achromatic-Lens-en-gb.aspx",
         "UriSegment":"11.5mm-dia-x-20mm-fl-grade-1-achromatic-lens",
         "Description":"",
         "Keywords":"",
         "LanguageCode":"en-gb"
      },
      {  
         "Title":"",
         "Uri":"115mm-Dia-x-20mm-FL-Grade-1-Achromatic-Lens-en-ie.aspx",
         "UriSegment":"11.5mm-dia-x-20mm-fl-grade-1-achromatic-lens",
         "Description":"",
         "Keywords":"",
         "LanguageCode":"en-ie"
      },
      {  
         "Title":"",
         "Uri":"115mm-Dia-x-20mm-FL-Grade-1-Achromatic-Lens-en-sg.aspx",
         "UriSegment":"11.5mm-dia-x-20mm-fl-grade-1-achromatic-lens",
         "Description":"",
         "Keywords":"",
         "LanguageCode":"en-sg"
      },
      {  
         "Title":"",
         "Uri":"115mm-Dia-x-20mm-FL-Grade-1-Achromatic-Lens-es-es.aspx",
         "UriSegment":"11.5mm-dia-x-20mm-fl-grade-1-achromatic-lens",
         "Description":"",
         "Keywords":"",
         "LanguageCode":"es-es"
      },
      {  
         "Title":"",
         "Uri":"115mm-Dia-x-20mm-FL-Grade-1-Achromatic-Lens-es-mx.aspx",
         "UriSegment":"11.5mm-dia-x-20mm-fl-grade-1-achromatic-lens",
         "Description":"",
         "Keywords":"",
         "LanguageCode":"es-mx"
      },
      {  
         "Title":"",
         "Uri":"115mm-Dia-x-20mm-FL-Grade-1-Achromatic-Lens-fr.aspx",
         "UriSegment":"11.5mm-dia-x-20mm-fl-grade-1-achromatic-lens",
         "Description":"",
         "Keywords":"",
         "LanguageCode":"fr"
      },
      {  
         "Title":"",
         "Uri":"115mm-Dia-x-20mm-FL-Grade-1-Achromatic-Lens-ja-jp.aspx",
         "UriSegment":"11.5mm-dia-x-20mm-fl-grade-1-achromatic-lens",
         "Description":"",
         "Keywords":"",
         "LanguageCode":"ja-jp"
      },
      {  
         "Title":"",
         "Uri":"115mm-Dia-x-20mm-FL-Grade-1-Achromatic-Lens-ko-kr.aspx",
         "UriSegment":"11.5mm-dia-x-20mm-fl-grade-1-achromatic-lens",
         "Description":"",
         "Keywords":"",
         "LanguageCode":"ko-kr"
      },
      {  
         "Title":"",
         "Uri":"115mm-Dia-x-20mm-FL-Grade-1-Achromatic-Lens-zh-cn.aspx",
         "UriSegment":"11.5mm-dia-x-20mm-fl-grade-1-achromatic-lens",
         "Description":"",
         "Keywords":"",
         "LanguageCode":"zh-cn"
      },
      {  
         "Title":"",
         "Uri":"115mm-Dia-x-20mm-FL-Grade-1-Achromatic-Lens-zh-tw.aspx",
         "UriSegment":"11.5mm-dia-x-20mm-fl-grade-1-achromatic-lens",
         "Description":"",
         "Keywords":"",
         "LanguageCode":"zh-tw"
      },
      {  
         "Title":"",
         "Uri":"32452",
         "UriSegment":"11.5mm-dia-x-20mm-fl-grade-1-achromatic-lens",
         "Description":"",
         "Keywords":"",
         "LanguageCode":"en"
      }
   ],
   "Prices":[  

   ],
   "EntryType":"Variation",
   "ChildCatalogEntries":[  

   ],
   "InventoryStatus":"Disabled",
   "WarehouseInventories":[  

   ],
   "Associations":[  

   ],
   "Assets":[  

   ],
   "Nodes":[  
      {  
         "Title":"Achromatic Lenses",
         "Type":"CatalogNode",
         "Href":"/episerverapi/commerce/nodes/310",
         "Properties":[  
            {  
               "Name":"Code",
               "Value":"310"
            }
         ]
      }
   ],
   "Variation":{  
      "MinQuantity":0.000000000,
      "MaxQuantity":0.000000000,
      "Weight":0.0,
      "TaxCategory":""
   }
}



Again, I'm looking to get the full url of the given entry. Any idea how to do this without doing additional calls to the parents to get the permalink of each parent product/node?

Thanks,

Paul

#151953
Aug 10, 2016 21:39
Vote:
 

Your post is the longest one, ever :).

Technically you can use Uri (115mm-Dia-x-20mm-FL-Grade-1-Achromatic-Lens-en-gb.aspx) to build SEO Uri (http://yoursite/115mm-Dia-x-20mm-FL-Grade-1-Achromatic-Lens-en-gb.aspx)

If you want to use the hierarchical Uri, then your only option is to extend Entry with a property named HierarchicalUri, then add a controller with an action to return your CustomEntry with UrlResolver.GetUrl(ContentReference) to get the value of HierarchicalUri. 

I haven't tried that myself, but that should be doable.

/Q

#151956
Aug 10, 2016 23:46
Vote:
 

Hi Quan,
My goal here was to make your longest initial post. Did I achieve my goal?

In seriousness, we do use Hierarchical UIL's. You'd mentioned using UrlResolver.GetUrl(ContentReference) however this won't work in a console application correct? We have a custom home built Faceted Search and we'd like to index this data using our current existing code. In order to do this we'll need to get this data indexed using a console application. UrlResolver.GetUrl(ContentReference) only works in the main website episerver project, not the api correct?

-Paul

#151994
Aug 11, 2016 19:16
Vote:
 

I'm not sure about UrlResolver - need to take a look at the code to see if it has dependencies on HttpContext (I think it hasn't, but I can be wrong). - but if you can't use it, simply write your code to get the Hierarchical. It's easy enough: get the IContent from ContentReference, cast it to IRoutable to get the UriSegment, then continue with its parent until you reach the Starting point. 

/Q

#151995
Aug 11, 2016 19:44
Vote:
 

When you referece to IContent, ContentReference and IRoutable, I believe all of these are native Episerver classes/methods. I'm using the Episerver API in a console application like the documentation below. This doesn't reference any of these classes/methods as, correct me if I'm wrong, I believe these exist only in the native Episerver website projects, not in console applications that use the API.

http://world.episerver.com/documentation/Items/Episerver-Service-API/

Am I going about this wrong? Should I use Nuget to include the Episerver reference in my console application, and run this with Episerver CMS attached to my project? This would allow me to use IContent, ContentReference and IRoutable class methods. I just don't know if this is supported.

-Paul

#151996
Aug 11, 2016 19:50
Vote:
 

ServiceAPI is just another Commerce (and therefore, CMS) application. So as long as you add the required references, you can access all those classes and methods. Of course some will require HttpContext to work, but not the content system.

/Q

#151997
Aug 11, 2016 19:55
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.