Search

CN-122027685-A - API access testing method and device, electronic equipment and storage medium

CN122027685ACN 122027685 ACN122027685 ACN 122027685ACN-122027685-A

Abstract

The application provides an API access testing method, device, electronic equipment and storage medium, which can display a testing interface based on an API to be accessed, which is associated with a target service scene determined by responding to user operation, wherein the interface comprises an operation control which is in corresponding relation with the API to be accessed and is used for controlling the testing of the corresponding API to be accessed, the API to be accessed in the target service scene is tested by responding to the operation of the user on the operation control, a testing result is obtained, and under the condition that the testing result shows that the testing is successful, the API to be accessed in the target service scene is put on shelf and packaged, the API combination corresponding to the target service scene is obtained, so that the scene is accessed, the user can select a certain scene by one key and the API access in the API combination of the scene is automatically associated and accessed, thereby effectively reducing the complicated operation when the user accesses the API, and enhancing the visualization of the API.

Inventors

  • WANG LIANGLIANG
  • LIAO JUN
  • WANG WEI
  • ZHANG YONGWEI
  • LI RUOYU

Assignees

  • 顺丰科技有限公司

Dates

Publication Date
20260512
Application Date
20241111

Claims (13)

  1. 1. An access testing method of an API, the method comprising: Determining a target service scene in response to a selection operation of a user; Displaying a debugging interface based on an API to be accessed associated with the target service scene, wherein the debugging interface comprises an operation control, a corresponding relation exists between the operation control and the API to be accessed, and the operation control is used for controlling the corresponding API to be accessed to be debugged; responding to the operation of the user on the operation control on the adjustment interface, adjusting the API to be accessed to be adjusted to obtain an adjustment result; And under the condition that the debugging result shows that the debugging is successful, putting the API to be accessed into the debugging, and packaging to obtain the API combination corresponding to the target service scene.
  2. 2. The method for accessing and testing an API according to claim 1, wherein said displaying a testing interface based on the API to be accessed associated with the target service scenario includes: Determining an API to be accessed and tested associated with the target service scene based on the service arrangement of the API interface service provider on all APIs; and displaying the operation control according to the arrangement sequence of the to-be-accessed call API associated with the target service scene in the service arrangement based on the corresponding relation between the operation control and the to-be-accessed call API.
  3. 3. The method for testing the API access according to claim 1, wherein said responding to the operation of the user on the operation control at the testing interface tests the API to be tested to obtain the testing result includes: Responding to the operation of the user on a target operation control, displaying a sub-control in the adjustment and measurement interface, wherein a corresponding relation exists between the sub-control and a sub-scene under a target API (application program interface), the target operation control is any one of the operation controls, the target API is an API to be accessed and measured corresponding to the target operation control, and the sub-control is used for controlling adjustment and measurement on the target API based on the sub-scene corresponding to the target operation control; Responding to the operation of the user on the target sub-control, and performing adjustment and measurement on the target API based on a target sub-scene to obtain an adjustment and measurement result, wherein the target sub-control is any one of the sub-controls, and the target sub-scene is a sub-scene corresponding to the target sub-control.
  4. 4. The method for accessing and tuning an API according to claim 3, wherein said displaying a child control in said tuning interface in response to said user's operation of a target operation control comprises: responding to the operation of the user on the target operation control, and displaying a default sub-control in the adjustment and measurement interface; judging whether a necessary sub-scene is absent in a default sub-scene corresponding to the default sub-control; If yes, generating configuration prompt information and displaying, configuring the necessary sub-scene under the target API based on the configuration prompt information, and additionally displaying a necessary sub-control on the debugging interface in response to the configuration of the necessary sub-scene, wherein the configuration prompt information is used for prompting the user to configure the necessary sub-scene, and the necessary sub-control is a sub-control corresponding to the necessary sub-scene.
  5. 5. The method for accessing and testing an API according to claim 4, wherein a first jump control is set in the configuration prompt message, and the configuring the necessary sub-scene under the target API based on the configuration prompt message includes: responding to the operation of the user on the first jump control, jumping to a first configuration interface, wherein the first configuration interface comprises the configuration control of the necessary sub-scene; And responding to the operation of the user on the configuration control of the necessary sub-scene, and configuring the necessary sub-scene into the sub-scene under the target API.
  6. 6. The method for adjusting access to an API according to claim 4, wherein a second jump control is provided in said adjustment interface, said method further comprising: Responding to the operation of the user on the second jump control, jumping to a second configuration interface, wherein the second configuration interface comprises a configuration control of a sub-scene to be configured, and the sub-scene to be configured comprises a necessary sub-scene and an optional sub-scene; and responding to the operation of the user on a target configuration control, configuring the target sub-scene to be configured as the sub-scene under the target API, wherein the target configuration control is at least one of the configuration controls, and the target sub-scene to be configured is the sub-scene to be configured corresponding to the target configuration control.
  7. 7. The method for accessing and testing the API according to claim 3, wherein said responding to the operation of the user on the target sub-control, testing the target API based on the target sub-scene, and obtaining the testing result includes: Responding to the operation of the user on the target sub-control, and pushing the simulation message under the target sub-scene to the user; if feedback given by the user for the simulation message is received and the feedback is a successful response of a preset format, determining that the adjustment and measurement result is successful; if the feedback is not received or the feedback is not a successful response in a preset format, determining that the tuning result is tuning failure.
  8. 8. The method for accessing and measuring the API according to claim 7, wherein said pushing the analog message in the target sub-scene to the user in response to the operation of the user on the target sub-control includes: Determining the click frequency of the user in response to the operation of the user on the target sub-control; And if the click frequency does not exceed the preset click frequency, pushing the simulation message under the target sub-scene to the user.
  9. 9. The method for access adjustment of an API according to claim 1, further comprising: Determining the initiation condition of an API call request; and judging whether to trigger a current limiting strategy or not based on the initiation condition.
  10. 10. The method for accessing and testing the API according to claim 1, wherein when the testing result indicates that the testing is successful, putting the API to be accessed and packaging the API to obtain the API combination corresponding to the target service scenario, comprising: Based on all the measurement results, counting the successful times of measurement of any API to be accessed in the target service scene; If the number of successful debugging times exceeds the preset debugging times, determining whether any API to be accessed is successfully debugged; And putting the API to be accessed into the call testing which is successfully tested on the shelf, and packaging the API to be accessed into the call testing to obtain the API combination of the target service scene.
  11. 11. An apparatus for access adjustment of an API, said apparatus comprising: the determining module is used for responding to the selection operation of the user and determining a target service scene; the display module is used for displaying a debugging interface based on the API to be accessed associated with the debugging target service scene, wherein the debugging interface comprises an operation control, a corresponding relation exists between the operation control and the API to be accessed, and the operation control is used for controlling the corresponding API to be accessed to be debugged; the adjustment and measurement module is used for responding to the operation of the user on the operation control at the adjustment and measurement interface, adjusting and measuring the API to be accessed to obtain an adjustment and measurement result; And the on-shelf packaging module is used for putting the APIs to be accessed into the test under the condition that the test result shows that the test is successful, and packaging the APIs to be accessed into the test result to obtain the API combination corresponding to the target service scene.
  12. 12. An electronic device comprising a memory and a processor; the memory is connected with the processor and used for storing programs; The processor is configured to implement the method for access adjustment of an API according to any one of claims 1 to 10 by running a program in the memory.
  13. 13. A storage medium having stored thereon a computer program which, when executed by a processor, implements the method of access metering of APIs of any of claims 1 to 10.

Description

API access testing method and device, electronic equipment and storage medium Technical Field The application relates to the technical field of logistics, in particular to an API access adjustment method, an API access adjustment device, electronic equipment and a storage medium. Background With the rapid expansion of the e-commerce market, the order volume is rapidly increased, the logistics demand is increased, and the demands of customers and third party docking logistics are also increasingly stringent. At present, when a client accesses a certain type of logistics application programming interface (application programming interface, API), pain points such as complicated access steps, lack of visual relevance among APIs, single push message scene of a push type API and the like exist. How to better implement the operation of accessing the API is a current urgent problem to be solved. Disclosure of Invention Based on the defects and shortcomings of the prior art, the application provides an API access testing method, system, electronic equipment and storage medium, which can display a testing interface comprising an operation control based on the selected API in a service scene, respond to the operation of a user on the operation control, test the API in the service scene to obtain a testing result, put on the shelf and package the API which is successfully tested based on the testing result to obtain the corresponding API combination for the service scene, realize the scene access, and enable the user to select a certain scene to access by one key and automatically associate the API of the scene. According to a first aspect of an embodiment of the present application, there is provided an access adjustment method for an API, including: Determining a target service scene in response to a selection operation of a user; Displaying a debugging interface based on an API to be accessed associated with the target service scene, wherein the debugging interface comprises an operation control, a corresponding relation exists between the operation control and the API to be accessed, and the operation control is used for controlling the corresponding API to be accessed to be debugged; responding to the operation of the user on the operation control on the adjustment interface, adjusting the API to be accessed to be adjusted to obtain an adjustment result; And under the condition that the debugging result shows that the debugging is successful, putting the API to be accessed into the debugging, and packaging to obtain the API combination corresponding to the target service scene. According to a second aspect of an embodiment of the present application, there is provided an access measurement apparatus for an API, including: the determining module is used for responding to the selection operation of the user and determining a target service scene; the display module is used for displaying a debugging interface based on the API to be accessed associated with the debugging target service scene, wherein the debugging interface comprises an operation control, a corresponding relation exists between the operation control and the API to be accessed, and the operation control is used for controlling the corresponding API to be accessed to be debugged; the adjustment and measurement module is used for responding to the operation of the user on the operation control at the adjustment and measurement interface, adjusting and measuring the API to be accessed to obtain an adjustment and measurement result; And the on-shelf packaging module is used for putting the APIs to be accessed into the test under the condition that the test result shows that the test is successful, and packaging the APIs to be accessed into the test result to obtain the API combination corresponding to the target service scene. According to a third aspect of embodiments of the present application, there is provided an electronic device comprising a memory and a processor; the memory is connected with the processor and used for storing programs; the processor is configured to implement the method for access adjustment of the API according to the first aspect by running a program in the memory. According to a fourth aspect of embodiments of the present application, there is provided a storage medium having stored thereon a computer program which, when executed by a processor, implements an access metering method of an API according to the first aspect. According to the API access testing method, device, electronic equipment and storage medium, the testing interface can be displayed based on the API to be accessed, which is associated with the target service scene determined by responding to the user operation, wherein the interface comprises the operation control which is in corresponding relation with the API to be accessed and is used for controlling the testing of the corresponding API to be accessed, the API to be accessed in the target service scene is