MCPcopy Index your code
hub / github.com/simstudioai/sim / parseWhatsAppResponse

Function parseWhatsAppResponse

apps/sim/tools/whatsapp/utils.ts:29–33  ·  view source on GitHub ↗
(response: Response)

Source from the content-addressed store, hash-verified

27}
28
29async function parseWhatsAppResponse(response: Response): Promise<Record<string, unknown>> {
30 const responseText = await response.text()
31 const parsed = responseText ? (JSON.parse(responseText) as unknown) : {}
32 return isRecord(parsed) ? parsed : {}
33}
34
35/** Extract a human-readable error message from a WhatsApp API error payload. */
36function extractErrorMessage(data: Record<string, unknown>, status: number): string {

Callers 1

Calls 3

textMethod · 0.80
parseMethod · 0.80
isRecordFunction · 0.70

Tested by

no test coverage detected