appBskyEmbedGetEmbedExternalView function
Resolve one AT-URI record into the data needed to render an enhanced external embed. The records are validated against the requested url before any view is built. When validation passes, returns data, associatedRefs (strongRefs to embed into a post's external.associatedRefs) and the raw associatedRecords, plus a legacy view for Standard.site records only. When validation fails, only unverifiedAssociatedRefs and unverifiedAssociatedRecords are returned and no view or data is built. The response is empty ({}) when no record URI was usable or the record could not be resolved; clients should fall back to their own link-card rendering in that case and skip writing strongRefs to the post.
Implementation
Future<XRPCResponse<EmbedGetEmbedExternalViewOutput>>
appBskyEmbedGetEmbedExternalView({
required String url,
AtUri? canonicalUri,
List<AtUri>? uris,
required ServiceContext $ctx,
String? $service,
Map<String, String>? $headers,
Map<String, String>? $unknown,
}) async => await $ctx.get(
ns.appBskyEmbedGetEmbedExternalView,
service: $service,
headers: $headers,
parameters: {
...?$unknown,
'url': url,
if (canonicalUri != null) 'canonicalUri': canonicalUri.toString(),
if (uris != null) 'uris': uris.map((e) => e.toString()).toList(),
},
to: const EmbedGetEmbedExternalViewOutputConverter().fromJson,
);