appBskyEmbedGetEmbedExternalView function

Future<XRPCResponse<EmbedGetEmbedExternalViewOutput>> appBskyEmbedGetEmbedExternalView({
  1. required String url,
  2. required List<AtUri> uris,
  3. required ServiceContext $ctx,
  4. String? $service,
  5. Map<String, String>? $headers,
  6. Map<String, String>? $unknown,
})

Resolve one or more AT-URIs into the data needed to render an enhanced external embed. Returns associatedRefs (strongRefs to embed into a post's external.associatedRefs), the raw associatedRecords, and a hydrated view. The response is empty ({}) when no records were resolvable, or when validation determined the resolved records don't actually back the requested URL; 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,
  required 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,
    'uris': uris.map((e) => e.toString()).toList(),
  },
  to: const EmbedGetEmbedExternalViewOutputConverter().fromJson,
);