Postman Sync
Postman Sync
Version required: 2023.2.3
Tips
To make the data synchronised to Postman more complete, it is recommended to select the sync after API save
option in the Postman config of the plugin then trigger the synchronization by saving the API.
It is also recommended to use this function to synchronize the API instead of exporting
Postman API usage
The plugin uses the Postman API to sync data. So it should be noted that Postman resource usage has a limit,click the link and pay attention to the Postman API Usage column, which can be used free of charge up to 1,000 times per month. Exceeding the quota will cause sync to fail!
Api key
API key is used to perform manual actions using the Postman Online API. These actions include creating collections, creating directories, creating requests, and more.
Open https://postman.co/settings/me/api-keys and login, and then generate an API key. It is recommended to create an API key without an expiration date.
WorkspaceId
The Workspace ID is the identifier for a Postman workspace. There are 2 strategies to create a workspace.
- Create one workspace for each project.(Recommended)
- Create one workspace to represent a company, and use different collections to represent different projects within the company.
Get WorkspaceId using the following steps↓↓↓
- Create a workspace (Ignore if exist)
- Click Workspace and click the Workspace info icon (Note that it is not click "Workspace Settings")
- Copy Workspace id
Initial value & Current value
Variable in Environment contains Initial value and Current value,Initial value is shared with your team,but Current value only store in your local. Request will finally use Current value.
Restful Fast Request in fact sync the Initial value of Environment.
So, if the environment values are updated in the plugin and sync successfully to Postman, when executing a request, Postman will not immediately use the synchronized values. Instead, you will need to manually replace the values in the environment tab or perform a complete replacement by clicking on "Reset All".
Pre and Post script
Due to language differences, the plugin does not synchronize pre-request and post-request scripts. Therefore, when using the plugin, it is recommended to write common scripts in the project-level config. This way, after synchronizing with Postman, you only need to write pre-request and post-request scripts at the collection level in Postman.
Note
- It is recommended to check the option "Sync to Postman after saving". If not checked, you need to save manually before triggering and then click on the Sync button.
- For teamwork, if multiple identical collections appear in the same workspace, you only need to manually replace the collection ID in the configuration with one of them.
- For teamwork, if multiple identical folders appear in the same collection, you can use the
pmFolderId
property in the.fastRequest/collections/ROOT/moduleName/className/directory.json
file from one of them. - For teamwork, if the same API exists twice in Postman, you can ensure consistency by modifying the
pmRequestId
andpmResponseId
of one of the data. You can use Multi-tab window to locate the stored file. The best way is to use Git to manage and commit therapi
files to keep the underlying storage data consistent.