aisensy_get_project
Get project
The AiSensy project (WhatsApp account) this key belongs to: name, status, plan and renewal date, monthly active user quota and usage, credit balance (raw units as AiSensy reports them), WhatsApp number, display name status, quality rating and messaging tier. GET /project/{project_id}.
無需輸入參數。
aisensy_list_templates
List WhatsApp templates
List the WhatsApp template messages of the project with name, language, status (PENDING, APPROVED, REJECTED), category, text and parameter count. Only APPROVED templates can be sent. Pages by record id: pass next_after from the previous reply as `after`. GET /project/{project_id}/wa_template/.
輸入參數afterlimitbefore
aisensy_get_template
Get WhatsApp template
One WhatsApp template by id, with status, rejection reason, buttons and text. GET /project/{project_id}/wa_template/{id}.
輸入參數template_id必填
aisensy_list_campaigns
List campaigns
List campaigns (API campaigns, broadcasts or both) with name, type, status, audience size, submitted count, template and creation time. Pages with skip + limit. POST /project/{project_id}/campaigns (a read: it only queries).
輸入參數skiplimitcampaign_type
aisensy_list_api_campaigns
List API campaigns
List the project's API campaigns (the campaigns messages can be sent through) with status and template. A campaign must be LIVE to send. GET /project/{project_id}/campaign/api.
無需輸入參數。
aisensy_get_api_campaign
Get API campaign
One API campaign by id: status, template, parameters and counts. GET /project/{project_id}/campaign/api/{campaign_id}.
輸入參數campaign_id必填
aisensy_get_campaign_analytics
Get campaign analytics
Daily delivery and credit-usage statistics of one campaign (sent, delivered, read, failed counts and message credit usage), optionally within a date range. POST /project/{project_id}/campaign/analytics/{campaign_id} (a read: it only queries).
輸入參數end_datestart_datecampaign_id必填
aisensy_list_campaign_audience
List campaign audience
Who a campaign was sent to, with name, number and sent/delivered/read times, optionally filtered by outcome (SENT, DELIVERED, READ, FAILED, REPLIED, CLICKED) and date range. Pages by cursor: pass next_after from the previous reply as `after`. GET /project/{project_id}/campaign/audience/{campaign_id}.
輸入參數sortafterlimitcategoryend_datestart_datecampaign_id必填
aisensy_create_api_campaign
Create API campaign
WRITE: create an API campaign that binds a name to an APPROVED WhatsApp template. It sends nothing; messages go out only when aisensy_send_campaign_message is called for it. Not idempotent: calling twice with the same name may create two campaigns or fail. POST /project/{project_id}/campaign/api.
輸入參數campaign_name必填template_name必填
aisensy_find_contact
Find contact by phone number
Look up a contact by phone number: id, name, tags, attributes, opt-in/chat state and last activity. 404 means no such contact. GET /project/{project_id}/contact?action=FetchContact&mobile_number=.
輸入參數phone_number必填
aisensy_get_contact
Get contact
One contact by id: name, phone number, tags, attributes, chat state and last activity. GET /project/{project_id}/contact/{contact_id}.
輸入參數contact_id必填
aisensy_create_contact
Create contact
WRITE: add a contact (name and phone number with country code). AiSensy opts new contacts in to WhatsApp notifications automatically, so only add people who agreed to be messaged. A number that already exists returns a 409 conflict. POST /project/{project_id}/contact.
輸入參數name必填phone_number必填
aisensy_update_contact
Update contact
WRITE: change a contact's name, custom attributes, WhatsApp opt-in status or blocked status. Setting opted_in=false stops campaign messages to that person; blocked=true blocks them. Only the fields you pass change. PATCH /project/{project_id}/contact/{contact_id}.
輸入參數nameblockedopted_inattributescontact_id必填
aisensy_upsert_contacts
Create or update contacts in bulk
WRITE (bulk): create or update up to 50 contacts by phone number in one call. Each row: phone_number, and optionally name (needed to create a new contact), attributes and opted_in. Without confirm=true it only PREVIEWS: it looks up every number and returns what would be created, updated (with the exact changes) or left unchanged. With confirm=true it looks each number up again and applies the rows one by one; a failed row does not stop the others, and every row reports its outcome (created, updated, unchanged, partial or failed). AiSensy ignores attribute names the project does not have: such fields come back in not_applied and the row is partial. Re-running the same rows changes nothing. AiSensy opts NEW contacts in to WhatsApp notifications automatically (opted_in=false on the row opts them out right after creation), so only add people who agreed to be messaged. Tags cannot be set here: the AiSensy Project API has no tag write for contacts. Uses GET/POST /project/{project_id}/contact and PATCH /project/{project_id}/contact/{contact_id}.
輸入參數confirmcontacts必填
aisensy_get_message
Get message
One WhatsApp message by id: status (SENT, DELIVERED, READ), sent/delivered/read times, sender, campaign, content and price. GET /project/{project_id}/messages/{message_id}.
輸入參數message_id必填
aisensy_send_campaign_message
Send campaign message
WRITE, SENDS A WHATSAPP MESSAGE TO A CUSTOMER AND SPENDS AISENSY CREDIT: send the template of a LIVE API campaign to one phone number (a new contact is created if the number is unknown). Not idempotent: every call sends again. template_params must match the template's parameter count. Show the user the recipient and the template first and set confirm=true only after they approve. POST /project/{project_id}/campaign/api/send.
輸入參數name必填tagssourceconfirm必填media_urlattributesphone_number必填campaign_name必填media_filenametemplate_paramsdefault_country_code
aisensy_send_message
Send WhatsApp message
WRITE, SENDS A WHATSAPP MESSAGE TO A CUSTOMER AND MAY SPEND AISENSY CREDIT: send either a free-text message (type=text; WhatsApp only delivers it inside the 24-hour window after the customer last wrote) or an approved template (type=template with template_name, language_code and body_params). Not idempotent. Show the user the recipient and the text first and set confirm=true only after they approve. POST /project/{project_id}/messages.
輸入參數texttype必填confirm必填body_paramsphone_number必填language_codetemplate_name