This article explains how to test the "Get Guarantees" (DOKA supports Get , Post , Put methods )API using Swagger UI. Swagger provides an interactive interface that helps you explore and test the API without writing any code.
Prerequisites:
User should have access to the API's Swagger UI documentation link.
Make sure user has proper authentication credentials to generate the CSRF token.
Steps to Test the API Using Swagger UI:
Access Swagger UI:
Open the Swagger UI for the API using the following link:
Surecomp DOKA API
Swagger UI - Get Guarantees API
The Swagger UI interface provides an overview of the available API endpoints. Scroll down to the section titled Guarantee and locate the method getGuaranteesBy.
Review API Parameters:
Before testing the API, review the required query parameters for the getGuaranteesBy method. These parameters are typically listed on the left side of the API method's details.
Examples of parameters might include things like guaranteeId, status, or customerId.
Fill in the Required Parameters:
Once you've identified the required parameters, enter the necessary values in the input fields on the Swagger UI.
Some parameters may be optional, while others will be required. Make sure to provide valid data based on your API's documentation.
Authenticate (If Needed):
If the API requires authentication, make sure to provide your credentials or CSRF token.
Test the API:
After filling in the required parameters and ensuring authentication, click the Try it out button.
Swagger will send the request to the API, and you should see the response displayed below the button.
Review the response to ensure the API is working as expected. If the request is successful, you should receive the data you requested, such as a list of guarantees.
Handle API Responses:
If the API responds with an error, check the status code and message to understand what went wrong. Common error codes include 400 Bad Request, 401 Unauthorized, or 500 Internal Server Error.
If the request is successful, you will see a 200 OK status with the expected data.
Example Response:
A successful response might look like this (example):
json
{
"_embedded": {
"list": [
{
"Reference": "GI24H00012",
"OpenedDate": "2024-08-20",
"ExpiredDate": "2024-11-18",
"ClosedDate": null,
"Name": "EUR 100,100.00 AE cs pvt ltd,london",
"ResponsibleUser": "CS_SHN",
"OpenTRNINR": "00000843",
"CreationDate": "2024-08-20",
"OldReference": "",
"AmendmentDate": "2024-08-20",
"OrderDate": "2024-08-20",
"AmendmentNumber": 1,
"PendingClaims": 1,
"OwnCharges": "U",
"LiabilityDate": null,
"Country": "AE",
"Version": "0003",
"HandlingType": "OL",
"ModifyGuaranteeText": "",
"ModifyGuaranteeText2": "",
"GeneratingTextINR": "",
"GeneratingTextINR2": "",
"GuaranteeLanguage": "EN",
"SecondGuaranteeLanguage": "",
"UnlimitedGuarantee": "",
"UnlimitedLiability": "",
"GuaranteeSendTo": "BEN",
"ReasonOfCancelation": "",
"PreadviceDate": "2024-08-20",
"ReadinessDeclaration": "",
"ReservedContract": "",
"GoodsCode": "",
"ReducedAmountCurrency": "",
"ReducedAmount": 0,
"ReductionDate": null,
"OutstandingAmountCurrency": "",
"OutstandingAmount": 0,
"ConfirmationStatus": "Y",
"PartialConfirmation": 100,
"ConfirmationDate": null,
"ConfirmedPercentage": "",
"IndemnityDeclaration": "",
"LeadingOriginalAmount": "A",
"DirectRejection": "",
"BilingualGuarantee": "",
"FinalExpiryDate": null,
"AdvicePeriod": 0,
"ExtensionPeriod": 0,
"NotifyPeriod": 0,
"AdvicePeriodType": "D",
"ExtensionPeriodType": "",
"NotifyPeriodType": "D",
"AutoExtension": "",
"DayOfTheMonth": "",
"ReinstatementPrincipleAmount1": "",
"ReinstatementPrincipleAmount3": "",
"ReinstatementDays": 0,
"AssignmentofProceeds": "",
"ApplicableRulesReimbursement": "",
"ParticipationSold": "",
"ChoiceofText": "",
"SendGuaranteeTo": "",
"RequestedDateofIssue": null,
"MessagePurpose": "ISSU",
"ConfirmationInstructions": "",
"AutomaticExtensionPeriod": "DAYS",
"AutomaticExtensionPeriodDetails": "",
"DemandIndicator": "NMLT",
"TransferIndicator": "",
"OriginalDelivery": "",
"OriginalDeliveryDetails": "",
"DeliveryTo": "",
"IncomingMessagePurpose": "",
"StandardWordingRequired": "",
"StandardWordingRequestedLanguage": "",
"AutomaticExtensionPeriodUndertaking": "",
"AutomaticExtensionPeriodUndertakingDetails": "",
"AutomaticExtensionNotificationPeriod": 0,
"AutomaticExtensionFinalExpiryDate": null,
"DeliveryOfOriginal": "",
"DeliveryOfOriginalUndertaking": "",
"DeliveryToUndertaking": "",
"ModifyGuaranteeTextUndertaking": "",
"DomesticGuarantee": "",
"DemandIndicatorUndertaking": "",
"TransferIndicatorUndertaking": "",
"ExtensionPeriodUndertaking": 0,
"OriginalAmountLeadingField": "",
"OrderDateUndertaking": null,
"GeneratingTextINRUndertaking": "",
"SR2021Standard": "Y",
"DraftNumber": 1,
"ReceivedConfirmationInstructions": "",
"AutoExtensionUndertaking": "",
"ATXGeneratingTextINR": "00000079",
"OrigianlIncomingUndertakingType": "",
"IncomingUndertakingType": "",
"ModifyDocumentAndPresentationInstructions": "",
"ModifyDocumentAndPresentationInstructionsUndertaking": "",
"ModifyExpiryCondition": "X",
"ModifyLiabilityCondition": "",
"ModifyObjectOfContract": "X",
"ModifyObjectOfContractUndertaking": "",
"ReimbursementInformation": "",
"ReimbursingBankCharges": "",
"ReimbursingBankAccount": "",
"AuthorizationDate": null,
"PlaceofExpiry": "",
"BillingualGeneratingTextINR": "",
"AvailableWith": "",
"IncomingCorporateMessage": "X",
"FacilityRecordINR": "",
"ObjectofContract": "",
"ObjectofContractUndertaking": "",
"SuppressApplicantCFlag": "",
"SuppressApplicantBFlag": "",
"CountrySubDivision": "",
"CountrySubDivisionSeqC": "",
"NegativeAmountTolerance": 0,
"NegativeAmountToleranceSeqC": 0,
"PositiveAmountTolerance": 0,
"PositiveAmountToleranceSeqC": 0,
"AdditionalAmountTextSeqCFlag": "",
"AdditionalAmountTextFlag": "",
"EntityHoldingSettlement": "HAMBURG",
"OriginalContractDate": "2024-08-20",
"OriginalContractReference": "Contract Ref",
"OriginalContractCurrency": "EUR",
"OriginalContractAmount": 100000,
"OriginalContractRate": 100.1,
"TenderReference": "Tender",
"TenderDate": "2024-08-20",
"TenderClosingDate": "2024-11-18",
"PlaceOfJurisdiction": "Algeria",
"LawOfJurisdiction": "Algeria",
"AdvancePaymentAccount": "",
"UndertakingType": "B",
"TransmitOriginalGuaranteeDate": null,
"LegalUndertakingForm": "DGAR",
"TypeofRequest": "D",
"FormofUndertaking": "",
"UndertakingTypeC": "",
"LiabilityTypeC": "",
"ExpiryType": "COND",
"GoverningLawCountryUndertaking": "",
"GoverningLawCountry": "DZ",
"DetailsofGoverningLaw": "",
"AmountofOriginalContract": 0,
"CurrencyofOriginalContract": "",
"OriginalContractDateUndertaking": null,
"OriginalContractRateUndertaking": 0,
"OriginalContractReferenceUndertaking": "",
"TenderClosingDateUndertaking": null,
"TenderReferenceUndertaking": "",
"TenderDateUndertaking": null,
"TransmitOriginalGuaranteeDateUndertaking": null,
"AdvancePaymentAccountUndertaking": "",
"PlaceOfJurisdictionUndertaking": "",
"ProductCode": "",
"ProductSubtype": "",
"ProductVariant": "",
"ModifyChoiceofText": "",
"ModifyChoiceofTextUndertaking": "",
"Parties": [
{
"ExternalKey": "0100060000001",
"PartyName": "Bank for Commerce of Dubai,Dubai",
"Role": "BEN",
"Reference": ""
},
{
"ExternalKey": "9875557555",
"PartyName": "cs pvt ltd,london",
"Role": "APL",
"Reference": ""
}
],
"Amounts": [
{
"Amount": 100000,
"Currency": "EUR",
"Instance": "MAX"
},
{
"Amount": 100000,
"Currency": "EUR",
"Instance": "OPN1"
},
{
"Amount": 100000,
"Currency": "EUR",
"Instance": "CNF"
},
{
"Amount": 100100,
"Currency": "EUR",
"Instance": "CNF"
},
{
"Amount": 100100,
"Currency": "EUR",
"Instance": "MAX"
},
{
"Amount": 100100,
"Currency": "EUR",
"Instance": "OPN1"
},
{
"Amount": 0,
"Currency": "EUR",
"Instance": "OPN1"
},
{
"Amount": 100,
"Currency": "EUR",
"Instance": "MAX"
},
{
"Amount": 100,
"Currency": "EUR",
"Instance": "OPN1"
},
{
"Amount": 100100,
"Currency": "EUR",
"Instance": "UTL"
}
]
}
]
},
"_links": {
"self": {
"href": "https://tfaas-dngapi.surecomp.com/v4/guaranteeProducts/guarantee/info?OwnReference=GI24H00012&page=0&size=20"
}
},
"page": {
"size": 20,
"totalElements": 1,
"totalPages": 1,
"number": 0
}
}
In case of errors, you may receive a message such as:
json
{
"_links": {
"self": {
"href": "https://tfaas-dngapi.surecomp.com/v4/guaranteeProducts/guarantee/info?OwnReference=%2A%2A%2A%2A%2A&page=0&size=20"
}
},
"page": {
"size": 20,
"totalElements": 0,
"totalPages": 0,
"number": 0
}
}
Using Swagger UI is a great way to test and interact with an API. This process helps ensure your request is correctly formatted and provides immediate feedback from the API. If you encounter issues, double-check the parameters, authentication, and review the API documentation for further guidance.
Refer artcile "API configuration" in DOKA to configure API settings in DOKA application
Comments
0 comments
Please sign in to leave a comment.