Skip to content

Commit 213bc75

Browse files
Gaafarfacebook-github-bot
authored andcommitted
add link for onprem migration
Differential Revision: D72437975 fbshipit-source-id: 4529d27eafcd4171243f7768977d08184be62ef0
1 parent f0aaf40 commit 213bc75

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

postman/v1/whatsapp-cloud-api.postman_collection.json

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"info": {
33
"_postman_id": "84d01ff8-4253-4720-b454-af661f36acc2",
44
"name": "WhatsApp Cloud API",
5-
"description": "[WhatsApp Cloud API](https://developers.facebook.com/docs/whatsapp/cloud-api), hosted by Meta, is the official WhatsApp Business Platform API used for business messaging. This collection contains common queries, sample responses, and links to supporting documentation that can help you quickly get started with the API.\n\n## Requirements\n\nTo use the API and this collection you must have a Meta business portfolio, a WhatsApp Business Account, and a business phone number. If you complete the steps in the Cloud API [Get Started](https://developers.facebook.com/docs/whatsapp/cloud-api/get-started) guide, these assets will be created for you.\n\n## Environment\n\nThis collection has a corresponding WhatsApp Cloud API Postman [environment](https://learning.postman.com/docs/sending-requests/managing-environments/) which you must select when using the collection. Set **current values** for the variables defined in this environment if you wish to use the collection to perform queries.\n\nYou can find most of these values in the [WhatsApp Manager](https://business.facebook.com/wa/manage/home/) or the **WhatsApp** > **Getting Started** panel in the [app dashboard](https://developers.facebook.com/apps). However, if you have an access token and your business portfolio ID, you can use queries in the collection to get the remaining values.\n\n## Access tokens\n\nThe API supports both user and system user access tokens. You can get a user access token by loading your app in the [app dashboard](https://developers.facebook.com/apps) and navigating to the WhatsApp > Getting Started panel. Alternatively you can use the [Graph API Explorer](https://developers.facebook.com/tools/explorer/) to generate one.\n\nSince user access tokens expire after 24 hours, you'll likely want to generate a system user access token, which lasts up to 60 days (or permanently, if you wish). See [Access Tokens](https://developers.facebook.com/docs/whatsapp/business-management-api/get-started#access-tokens) to learn how to create a system user and system user access token.\n\nOnce you have your token, save it as a **current value** in the environment.\n\n## Business portfolio ID\n\nYou can get your business portfolio ID by signing into the [Meta Business Suite](https://business.facebook.com). The ID appears in the URL as the `business_id` query string parameter value. Once you save this as a **current value** in the environment, go to the WhatsApp Business Account (WABA) folder and run the **Get all owned WABAs** query. This will return your WABA ID, which you can save to your environment and then use to determine your business phone number ID.\n\n## Permissions\n\nThe API only relies on two permissions:\n\n- whatsapp_business_management\n- whatsapp_business_messaging\n \n\nNote that if you get a user access token from the app dashboard, your app will automatically be granted these permissions (by you, on your behalf), so you can use the token to test right away.\n\nQueries that target your business portfolio require the business_management permission, which you may also need based on your business use case. Most developers do not need this permission, however, as accessing your business portfolio is uncommon, and the Meta Business Suite provides nearly all of this functionality anyway.\n\n## Access token debugger\n\nYou can paste any token you generate into the [access token debugger](https://developers.facebook.com/tools/debug/accesstoken/) to see what type of token it is and what permission you have granted to your app.\n\n## Pagination\n\nEndpoints that return lists/collections may [paginate results](https://developers.facebook.com/docs/graph-api/results) (you'll see previous and next properties in the response). Use the URLs from these properties to get the previous or next set of results. Note that if you click one of these links in Postman, it will open a new query in a new tab which you must save before running (otherwise it can't read your environment variables), so you may wish to cut and paste the URL and run the query in the same tab in which it was returned.",
5+
"description": "[WhatsApp Cloud API](https://developers.facebook.com/docs/whatsapp/cloud-api), hosted by Meta, is the official WhatsApp Business Platform API used for business messaging. This collection contains common queries, sample responses, and links to supporting documentation that can help you quickly get started with the API.\n\n## Requirements\n\nTo use the API and this collection you must have a Meta business portfolio, a WhatsApp Business Account, and a business phone number. If you complete the steps in the Cloud API [Get Started](https://developers.facebook.com/docs/whatsapp/cloud-api/get-started) guide, these assets will be created for you.\n\n## Migrating from On-Premises API to Cloud API\n\n[This guide explains how to migrate](https://developers.facebook.com/docs/whatsapp/cloud-api/guides/migrating-from-onprem-to-cloud) business phone numbers from On-Premises API to Cloud API.\n\n## Environment\n\nThis collection has a corresponding WhatsApp Cloud API Postman [environment](https://learning.postman.com/docs/sending-requests/managing-environments/) which you must select when using the collection. Set **current values** for the variables defined in this environment if you wish to use the collection to perform queries.\n\nYou can find most of these values in the [WhatsApp Manager](https://business.facebook.com/wa/manage/home/) or the **WhatsApp** > **Getting Started** panel in the [app dashboard](https://developers.facebook.com/apps). However, if you have an access token and your business portfolio ID, you can use queries in the collection to get the remaining values.\n\n## Access tokens\n\nThe API supports both user and system user access tokens. You can get a user access token by loading your app in the [app dashboard](https://developers.facebook.com/apps) and navigating to the WhatsApp > Getting Started panel. Alternatively you can use the [Graph API Explorer](https://developers.facebook.com/tools/explorer/) to generate one.\n\nSince user access tokens expire after 24 hours, you'll likely want to generate a system user access token, which lasts up to 60 days (or permanently, if you wish). See [Access Tokens](https://developers.facebook.com/docs/whatsapp/business-management-api/get-started#access-tokens) to learn how to create a system user and system user access token.\n\nOnce you have your token, save it as a **current value** in the environment.\n\n## Business portfolio ID\n\nYou can get your business portfolio ID by signing into the [Meta Business Suite](https://business.facebook.com). The ID appears in the URL as the `business_id` query string parameter value. Once you save this as a **current value** in the environment, go to the WhatsApp Business Account (WABA) folder and run the **Get all owned WABAs** query. This will return your WABA ID, which you can save to your environment and then use to determine your business phone number ID.\n\n## Permissions\n\nThe API only relies on two permissions:\n\n- whatsapp_business_management\n \n- whatsapp_business_messaging\n \n\nNote that if you get a user access token from the app dashboard, your app will automatically be granted these permissions (by you, on your behalf), so you can use the token to test right away.\n\nQueries that target your business portfolio require the business_management permission, which you may also need based on your business use case. Most developers do not need this permission, however, as accessing your business portfolio is uncommon, and the Meta Business Suite provides nearly all of this functionality anyway.\n\n## Access token debugger\n\nYou can paste any token you generate into the [access token debugger](https://developers.facebook.com/tools/debug/accesstoken/) to see what type of token it is and what permission you have granted to your app.\n\n## Pagination\n\nEndpoints that return lists/collections may [paginate results](https://developers.facebook.com/docs/graph-api/results) (you'll see previous and next properties in the response). Use the URLs from these properties to get the previous or next set of results. Note that if you click one of these links in Postman, it will open a new query in a new tab which you must save before running (otherwise it can't read your environment variables), so you may wish to cut and paste the URL and run the query in the same tab in which it was returned.",
66
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
77
"_exporter_id": "29882223",
88
"_collection_link": "https://www.postman.com/meta/whatsapp-business-platform/collection/wlk6lh4/whatsapp-cloud-api?action=share&source=collection_link&creator=29882223"
@@ -585,20 +585,6 @@
585585
"item": [],
586586
"description": "When you receive an incoming message from Webhooks, you can use the `/messages` endpoint to change the status of it to read. We recommend marking incoming messages as read within 30 days of receipt.\n\nYou cannot mark outgoing messages you sent as read.\n\n## Step 1: Obtain `message_id` of incoming message\n\nFirst, find the `message_id` for the message you want to mark as `read`. You can find this ID in the webhooks notification you get when you receive a message. See [Webhooks](https://developers.facebook.com/docs/whatsapp/cloud-api/webhooks) for information.\n\n## Step 2: Make API call to update message status\n\nCall the `/PHONE_NUMBER_ID/messages` endpoint and include your `message_id`. Set the `status` field to `read`:\n\n``` json\ncurl -X POST \\\n 'https://graph.facebook.com/{{Version}}/FROM_PHONE_NUMBER_ID/messages' \\\n -H 'Authorization: Bearer SYSTEM_USER_ACCESS_TOKEN' \\\n -d '{\n \"messaging_product\": \"whatsapp\",\n \"status\": \"read\",\n \"message_id\": \"MESSAGE_ID\"\n }\n}' \n\n```\n\nA successful response looks like this:\n\n``` json\n{\n \"success\": true\n}\n\n```\n\nFor more information on marking messages as read, see [Mark Messages as Read](https://documenter.getpostman.com/view/13382743/UVC5FTHT#b481139d-c887-40ec-8c07-732d1b69d468) in the Cloud API reference."
587587
},
588-
{
589-
"name": "Migrate Between On-Premise and Cloud API",
590-
"item": [
591-
{
592-
"name": "On-Premise to Cloud API",
593-
"item": [],
594-
"description": "To migrate from On-Premises to Cloud API, follow these steps:\n\n**Optional Step 0: Verify Phone Numbers**\n\n*(This step is only relevant if you don’t have access to Embedded Signup to verify phone numbers. If that doesn’t apply to you, move to Step 1.)*\n\nThe verification status of a phone number doesn't impact the migration between On-Premises and Cloud API. If you don't have access to Embedded Signup to verify phone numbers, we recommend verifying the phone numbers using the On-Premises solution, and then migrating those numbers to the Cloud API.\n\n**Step 1: Select Best Time for Migration**\n\nWe recommend performing migration during a maintenance window while traffic to the On-Premises deployment is low/turned off. Downtime is typically less than 5 minutes, and no re-verification of the phone number is required.\n\n**Step 2: Backup On-Premises Content**\n\nWe don’t provide full database migration, so you must back up your data before moving a phone number from On-Premises to Cloud API. Before starting the backup, make sure you are in single instance mode and not multi-connect.\n\nOnce you are ready, use the On-Premises [Backup API](https://developers.facebook.com/docs/whatsapp/api/settings/backup-and-restore/):\n\n``` json\nPOST /v1/settings/backup \n{ \n \"password\": \"your-password\" \n}\n\n```\n\nA successful response looks like this:\n\n``` json\n{ \n \"settings\": \n { \n \"data\": \"encrypted-backup-data\" \n } \n}\n\n```\n\nSave the data for the next step.\n\n**Step 3: Call /register to Start Migration**\n\nTo migrate your account, make a **POST** call to the **`PHONE_NUMBER_ID/register`** endpoint. Inside the backup object, include the backup data obtained during the previous step:\n\n``` bash\n`curl -X POST \\ 'https://graph.facebook.com/{{Version}}/FROM_PHONE_NUMBER_ID/register' \\\n-H 'Authorization: Bearer SYSTEM_USER_ACCESS_TOKEN' \\ \n-d '{ \n \"messaging_product\": \"whatsapp\",\n \"pin\": \"6_DIGIT_PIN\",\n \"backup\": \n { \n \"password\": \"PASSWORD\", \n \"data\": \"BACKUP_DATA\" \n } \n}'\n\n```\n\nA successful response looks like this:\n\n``` json\n{ \n \"success\": \"true\" \n}\n\n```\n\nSee all available fields for this endpoint [here](https://developers.facebook.com/docs/whatsapp/cloud-api/reference/account-migration#parameters).\n\n**Step 4: Prepare to Send Messages**\n\nYou have been migrated to the Cloud API. But, before sending messages, you should perform necessary operations, like [re-uploading media files](https://developers.facebook.com/docs/whatsapp/cloud-api/reference/media) you want to send. Be aware that data (messages, media, etc.) received on the On-Premises API deployment before migration won’t be available in the Cloud API after migration.\n\n**Step 5: Start Sending Messages**\n\nYou are ready to send messages to your customers. See the [/messages endpoint documentation](https://developers.facebook.com/docs/whatsapp/cloud-api/reference/messages) for guidance."
595-
}
596-
],
597-
"description": "This guide walks you through the process of migrating between On-Premises and Cloud API.\n\n* [Migrate from On-Premises API to Cloud API](#c2070ecb-9bf6-41c8-8452-7209c7820254)\n* [Migrate from Cloud API to On-Premises API](#46bb6f38-12f5-417f-af0b-729c08c027fe)",
598-
"auth": {
599-
"type": "noauth"
600-
}
601-
},
602588
{
603589
"name": "Sell Products and Services",
604590
"item": [],

0 commit comments

Comments
 (0)