An application program interface (API) is a set of subroutine definitions, communication protocols that allow two software programs to communicate with each other. There are a few new APIs in the Opkey which allow users to get the execution result of their executed Test Cases and without accessing Opkey directly by using API Tools like Postman & SoapUI.
The Need of Opkey APIs
APIs work as a bridge of communication between two applications over a network. If an Opkey user wants to get details of the execution result of Test Cases and Suites then he/she can use these APIs with an API Tool like Postman & SoapUI.
Getting started with OpKey APIs
Let us start using the OpKey APIs on Postman API Tool to get the execution result details about the executed Test Case and Suites. An API URI composed of URL (OpKey Web domain URL), with Resource Path & Query Parameter i.e.
API URI = URL + Resource_Path + Query_Parameter
Note: Some API URIs don’t contain Query Parameters.
(1) Authorize
This API is used to get the Authorization Token by using the Username and Password of OpKey Web using the POST method.
If OpKey Web domain URL is https://www.xyz.myopkey.com then…
Note: Here, the API URI depends on the OpKey Web domain name.
(2) GetSuiteResult
This API fetches the details about the execution result of Suite in Json format. This API takes few Query Parameters and Authorization Tokens as input using Get Method.
If OpKey Web domain URL is https://www.xyz.myopkey.com then…
Note: Here, the API URI and Query Parameters are variable in nature which depend on your Project, Build, Session etc.
(3) GetTestCaseResult
This API fetches the details about the execution result of the Test Case in Suite. This API takes few Query Parameters and Authorization Tokens as input using Get Method. You need to run the GetSuiteResult API in order to get the Test Case Step ID which is required as a Query Parameter in this API (GetTestCaseResult) for getting the Test Case Result.
If OpKey Web domain URL is https://www.xyz.myopkeycom then…
Note: Here, the API URI and Query Parameters are variable in nature which depend on your Project, Build, Session, Test Case Step ID etc.
Thus, you don’t need to access the OpKey Web to get the test case or Suite execution result. You can use these above-mentioned APIs to do get the test case or Suite execution result details.
(4) GetAllSessionsOfABuild
This API is used to get all the sessions from an executed build. This API takes a few Query Parameters and Authorization Token as input using GET Method.
If the OpKey Web Domain URL is https://www.xyz.myopkey.com then…
API URI (Variable) – https://xyz.smartopkey.com/api/OpkeyRestV2/GetAllSessions?ProjectName=NameofProject&BuildName=NameofBuild
Resource Path (Static) – /api/OpkeyRestV2/GetAllSessions
Query Parameter (Variable) : ? ProjectName=NameofProject&BuildName=NameofBuild
NOTE : Here the API URI and Query Parameters are variable in nature which depends on your Project and Build Name.
(5) GetAllSessionsOfProject
This API is used to fetch all the details of the execution result of all sessions from a project. This API takes a few Query Parameters and Authorization Token as input using GET Method.
API URI Variable – https://xyz.smartopkey.com/api/OpkeyRestV2/GetAllBuilds?ProjectName=NameofProject
Resource Path (Static) – /api/OpkeyRestV2/GetAllSessions
Query Parameter (Variable) – ?ProjectName=NameofProject
Note: Here the API URI and Query Parameter will be variable in nature which will depend on your Project Name
(6) GetAllTagsOfSession
This API is used to fetch the details about the execution result of all tags of a session. This API takes a few Query Parameters and Authorization Token as input using GET Method.
API URI – https://xyz.smartopkey.com/api/OpkeyRestV2/GetSessionTags?ProjectName=NameofProject&BuildName=NameofBuild&SessionName=NameofSession
Resource Path (Static) – /api/OpkeyRestV2/GetSessionTags
Query Parameter (Variable) – ?ProjectName=NameofProject&BuildName=NameofBuild&SessionName=NameofSession
Note: Here the API URI and Query Parameter will be variable in nature which will depend on your Project Name, Build Name, and Session Name
METADATA APIs
(7) GetAllMetadataBuild
This API fetches the details about the Project’s MetadataBuild in Json format. This API takes few Query Parameters and Authorization Tokens as input using GET method.
If OpKey Web Domain URL is https://www.xyz.myopkey.com then
ProjectName=ABC
Note: Here, the API URI and Query Parameters are variable in nature which depend on your Project, Build, Session, etc.
(8) GetAllMetadataSessionOfBuild
This API is used to fetch all MetaData Session of Build in Json format. This API takes a few query Query Parameters and Authorization Tokens as input using GET method.
(9) GetSessionMetadata
This API fetches the details about the execution result of MetaData Session in Json Format. This API is used to fetch all MetaData Session of Build in Json format. This API takes few query Query Parameters and Authorization Tokens as input using GET method.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article