Fetch full contact details from Starface instead of summary
The contacts list endpoint only returns summaryValues/phoneNumbers.
Now fetch each contact individually via GET /contacts/{id} to get
all fields (blocks/attributes). Also log the detail JSON structure
so we can verify the field mapping is correct.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
3c38a1a6cc
commit
1be0a94b51
|
|
@ -209,15 +209,34 @@ namespace StarfaceOutlookSync.Services
|
||||||
|
|
||||||
if (array.Count == 0) break;
|
if (array.Count == 0) break;
|
||||||
|
|
||||||
// Ersten Kontakt als Debug-Info loggen
|
OnDebug?.Invoke($"Seite {page}: {array.Count} Kontakte in Liste");
|
||||||
if (firstPage && array.Count > 0)
|
|
||||||
|
// Die Listen-API gibt nur Summary zurueck.
|
||||||
|
// Jeden Kontakt einzeln abrufen fuer alle Felder.
|
||||||
|
foreach (var item in array)
|
||||||
{
|
{
|
||||||
OnDebug?.Invoke($"Starface API Rohdaten (1. Kontakt):\n{array[0].ToString(Formatting.Indented)}");
|
var id = item["id"]?.ToString();
|
||||||
|
if (string.IsNullOrEmpty(id)) continue;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var detailResp = await _http.GetAsync($"{_baseUrl}/contacts/{id}");
|
||||||
|
if (detailResp.IsSuccessStatusCode)
|
||||||
|
{
|
||||||
|
var detailBody = await detailResp.Content.ReadAsStringAsync();
|
||||||
|
var detailObj = JObject.Parse(detailBody);
|
||||||
|
|
||||||
|
if (firstPage)
|
||||||
|
{
|
||||||
|
OnDebug?.Invoke($"Starface Kontakt-Detail (1. Kontakt):\n{detailObj.ToString(Formatting.Indented)}");
|
||||||
firstPage = false;
|
firstPage = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var item in array)
|
contacts.Add(MapFromStarface(detailObj));
|
||||||
contacts.Add(MapFromStarface(item));
|
}
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
}
|
||||||
|
|
||||||
if (array.Count < pageSize) break;
|
if (array.Count < pageSize) break;
|
||||||
page++;
|
page++;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue