Developer Platform
  • Home
  • Getting Started
    • General Information
    • Features Overview
    • Security
  • APPs
    • Public Apps
      • Shopify
      • Salesforce
      • Zendesk
      • Google Analytics
    • Build your App
      • Getting started
      • My Apps
      • App information
      • App Parameters
      • App Plugins
      • Add Webhooks
      • Submit your Apps
      • App security
      • Developer Policy
  • Use Cases
    • Copilots
      • Product Catalog sync through API
      • FAQ sync through API
    • Visitor experience
      • Integrating custom buttons into your site
      • Check availability before escalating to iAdvize
      • Authenticated Messaging
        • Introduction
        • Web client-side implementation
          • Authenticated Messaging overview
          • Brief timeline of the integration process
          • How to enable authenticated mode in the administration portal?
          • How to implement the customer authentication backend (token provider)?
          • How to authenticate with iAdvize in client's website?
          • How to deal with activation success or failure?
          • How to logout?
          • Compatibility with Mobile SDK
          • FAQ
        • Web backend implementation
          • Important information and recommendations
          • Signature and Encryption Detailed Process
          • Technical backend implementation
          • FAQ
      • Cross-domain Conversation Continuity
      • Customize replies with Markdown
    • Agent workspace
      • Custom App example and step-by-step tutorial
        • Get Started
        • Work with the Desk
        • Intent / Trigger
        • JWT
        • References
    • Administration
      • Users
        • SAML SSO Authentication - Implementation Guide
        • Create, update and delete users via API
        • Manage the availability of your users with the iAdvize API
        • Integrate the iAdvize conversation panel into an existing tool
      • Anonymize a conversation or visitor data
    • Data & Analytics
      • Extract conversation transcript
      • Retrieve metrics and KPIs
        • Pre-aggregated indicators
        • Understand transaction data
        • Understand conversation data 1/2
        • Understand conversation data 2/2
        • Understand satisfaction data
        • Understand production indicators
  • Technologies
    • GraphQL API
      • Terminology
      • Reference
      • Authentication
      • Schema lifecycle
      • Error Management
      • Pagination
    • REST API (deprecated)
      • Statistic (deprecated)
      • Group (deprecated)
      • Call meeting (deprecated)
      • Operator (deprecated)
      • Skill (deprecated)
      • Transaction (deprecated)
      • Visitor (deprecated)
    • Webhooks
      • Reference
      • Guides
    • Desk events
      • Reference
    • Web & Mobile SDK
      • Javascript Web SDK
        • Reference
      • Javascript Callbacks
        • Reference
        • Guides
      • Mobile SDK
        • Gaperon (latest)
        • Fourme
        • Epoisses
        • Dauphin
        • 🤝Support Policy
        • 🤔Frequently Asked Questions
    • Custom App
    • External Bot
      • Implementation
        • Configuration flow
        • Conversation flow
        • Conversation objects
      • Configuration
      • FAQ
      • Best practices
Powered by GitBook
On this page
  • Use the library
  • Client
  • idzCpa
  • insertTextInComposeBox(string)
  • pushCardInConversationThreat(Card)
  • pushCardBundleInConversationThread(Carousel)
  • getJWT() : string
  • ApplePay
  • pushApplePayPaymentRequestInConversationThread(ApplePayPaymentRequestType) : Promise

Was this helpful?

  1. Use Cases
  2. Agent workspace
  3. Custom App example and step-by-step tutorial

References

Use the library

Include this javascript bundle in the html

<script src="https://static.iadvize.com/conversation-panel-app-lib/2.9.0/idzcpa.umd.production.min.js"></script>

Client

idzCpa

Global cariable used as the entry point of the CPA library, stored in window

init() : Promise

Client is obtained using idzCpa.init that returns a Promise

window.idzCpa.init().then(client => {
    //some code
})

context

Returns the client's information in the form of a Context object

 type Context = {
    conversationId: string;
    projectId: string;
    channel: Channel;
    language: string;
}

conversationId : id of the conversation between the client and the operator

projectId : Id of the project you launch the desk on

channel : Type of channel :

  AppleBusinessChat = 'APPLE_BUSINESS_CHAT',
  Call = 'CALL',
  Chat = 'CHAT',
  Facebook = 'FACEBOOK',
  FacebookBusinessOnMessenger = 'FACEBOOK_BUSINESS_ON_MESSENGER',
  MobileApp = 'MOBILE_APP',
  Sms = 'SMS',
  Video = 'VIDEO',
  Whatsapp = 'WHATSAPP',

language : language of the client

insertTextInComposeBox(string)

Insert the text passed in parameters into the compose box

pushCardInConversationThreat(Card)

Push the card passed in parameters into the conversation thread

type Action = {
  type: "LINK";
  title: string;
  url: string;
};

type Card = {
  title?: string;
  text?: string;
  actions: Action[];
  image?: {
      url: string;
      description: string;
  }
};

pushCardBundleInConversationThread(Carousel)

Push the card bundle passed in parameters in the conversation thread

type Carousel = {
  title?:string;
  cards: Card[]
}

getJWT() : string

Returns the JWT of the desk

ApplePay

pushApplePayPaymentRequestInConversationThread(ApplePayPaymentRequestType) : Promise

Insert an ApplePay payment request in the conversation, returns a promise. If the payment is successful => execute promise.then(()=>{ }) If there is an error in the payment => execute promise.catch((e : ActionError)=>{ })

type ApplePayPaymentRequestType = {
    requestIdentifier: UUID;
    payment: ApplePayPaymentRequest;
    receivedMessage: ApplePayReceivedMessage;
}

// Detail for payment field type
type ApplePayPaymentRequest {
  currencyCode: string;
  lineItems: PaymentItem[];
  requiredBillingContactFields: ApplePayContactField[];
  requiredShippingContactFields: ApplePayContactField[];
  shippingMethods: ShippingMethod[];
  total: PaymentItem;
}

type PaymentItem = {
  amount: string;
  label: string;
  type: ApplePayLineItemType;
};

enum ApplePayLineItemType {
  final,
  pending,
}

type ShippingMethod = {
  amount: string;
  detail: string;
  identifier: string;
  label: string;
};

enum ApplePayContactField {
  email = 'email',
  name = 'name',
  phone = 'phone',
  postalAddress = 'postalAddress',
  phoneticName = 'phoneticName',
}

// type for receivedMessage field
type ApplePayReceivedMessage {
  type: 'CARD';
  data: CardType;
}

type CardType = {
  title?: string;
  text?: string;
  image?: CardImage;
  actions: LinkAction[];
};

type CardImage = {
  url: string;
  description: string;
};

type LinkAction = {
  type: 'LINK';
  title: string;
  url: string;
};

// Error
type ActionError = {
    message: string;
    details?: string[];
}

client.pushApplePayPaymentRequestInConversationThread(applePayPaymentRequest: ApplePayPaymentRequestType): Promise
PreviousJWTNextAdministration

Last updated 5 months ago

Was this helpful?