1. UploadAttachmentFile
PKFARE Flight Buyer API
  • Guides
    • Quick Start
    • Tricks for Playing with PKFARE API
    • Book air tickets with ancillaries
    • Raise refund requests
    • Raise change requests
    • Receive flight rescheduled notification
    • Add Paid Bags after the Booking
    • Branded Fare Integration Guide
  • API Reference
    • Air ticket booking APIs
      • TicketIssuanceNotify_V2
      • Shopping V10
      • PrecisePricing V12
      • Penalty V4
      • PreciseBooking V8
      • CancelOrder
      • OrderPricing V6
      • Ticketing
      • OrderDetail V14
      • RequestTicketing
      • ModifyOrderStatus
    • Ancillary booking APIs
      • AncillaryStatusPush
      • AncillaryPricing V6
      • AncillaryBooking
      • CancelAncillaryOrder
      • AncillaryTicketing
      • AncillaryOrderDetail
    • Flight schedule change APIs
      • ScheduleChangeNotify
      • GetScheduleChangeReply
      • GetScheduleChangeList
      • AcknowledgeScheduleChange
      • AcceptScheduleChange
    • Refund APIs
      • RefundResultNotify
      • ReimbursedResultNotify
      • Refund Pricing
      • CheckRefundPricing
      • RefundRequest
      • CheckRefund
      • CheckReimbursed
      • DownloadAttachmentFile API
      • UploadAttachmentFile API
    • Change APIs
      • ChangeResultPush
      • Change Reshop
      • Change Request
      • Change Passenger Info
      • Change Reprice
      • ChangeRepricePush
    • Void APIs
      • ReimbursedResultPush
      • VoidRequest
    • Cache APIs
      • CacheShopping
      • ValidateItinerary API
    • APIs with all versions
      • CheckInInfoPush
      • Raise change requests Copy
      • Shopping
        • Shopping
        • Shopping_V2
        • Shopping_V4
        • Shopping V7
        • Shopping V9
        • Shopping V8
      • PrecisePricing
        • PrecisePricing
        • PrecisePricing_V2
        • PrecisePricing_V6
        • PrecisePricing V9
        • PrecisePricing V10
        • PrecisePricing V11
      • Penalty
        • Penalty
        • Penalty V2
        • Penalty V3
      • PreciseBooking
        • PreciseBooking
        • PreciseBooking_V2
        • PreciseBooking_V5
        • PreciseBooking V6
        • PreciseBooking V7
      • OrderPricing
        • OrderPricing_V2
        • OrderPricing V4
        • OrderPricing V5
      • Ticketing
        • Ticketing
      • TicketNumPush
        • TicketingNumPush
        • TicketingNumPush_V2
        • TicketingNumPush_V3
        • TicketIssuanceNotify
      • CancelOrder
        • CancelOrder
      • OrderDetail
        • OrderDetail_V2
        • OrderDetail_V3
        • OrderDetail_V4
        • OrderDetail_V5
        • Json_OrderDetail_V7
        • Json_OrderDetail_V8
        • OrderDetail V9
        • OrderDetail V13
      • AncillaryPricing
        • AncillaryPricing
        • AncillaryPricing V5
      • AncillaryBooking
        • AncillaryBooking
      • CancelAncillaryOrder
        • CancelAncillaryOrder
      • AncillaryTicketing
        • AncillaryTicketing_V2
      • AncillaryStatusPush
        • AncillaryStatusPush
      • AncillaryOrderDetail
        • AncillaryOrderDetail
      • RequestTicketing
        • RequestTicketing
      • ScheduleChangeNotify
        • ScheduleChangeNotify
      • GetScheduleChangeList
        • GetScheduleChangeList
      • AcknowledgeScheduleChange
        • AcknowledgeScheduleChange
      • AcceptScheduleChange
        • AcceptScheduleChange
      • GetScheduleChangeReply
        • GetScheduleChangeReply
      • RefundPricing
        • RefundPricing
      • CheckRefundPricing
        • CheckRefundPricing
      • RefundRequest
        • RefundRequest
      • RefundResultNotify
        • RefundResultNotify
      • CheckRefund
        • CheckRefund
      • ReimbursedResultNotify
        • ReimbursedResultNotify
      • CheckReimbursed
        • CheckReimbursed
      • UploadAttachmentFile
        • UploadAttachmentFile
      • DownloadAttachmentFile
        • DownloadAttachmentFile
      • ChangeReshop
        • ChangeReshop
      • ChangeRequest
        • ChangeRequest
      • ChangePassengerInfo
        • ChangePassengerInfo
      • VoidRequest
        • VoidRequest
        • VoidRequest_V2
      • ReimbursedResultPush
        • ReimburseResultPush_V2
  • Development Instructions
    • Signature
    • Order Status Explanation
    • Booking errors explanation and suggestions
    • Price Breakdown Explanation
    • Airlines available from PKFARE
    • PKFARE Operation Notice
    • How to retrieve airlines'PNR and ticket numbers
    • PKFARE Buyer API solutionId Usage Guide
  • Notice
    • Release Note
  • Schemas
    • Schemas
      • ShoppingReq
      • Result«ShoppingResult»
      • Authentication
      • SearchDTO
      • JourneysDTO_1
      • PassengersDTO
      • ShoppingResult
      • SegmentsDTO
      • SolutionsDTO
      • BaggageDTO
      • ConditionsDTO
      • ChangeDTO
      • OtherDTO
      • RefundDTO
      • JourneysDTO
      • SegmentInfoDTO
  1. UploadAttachmentFile

UploadAttachmentFile

1 Description#

1.1 Function#

Some Api requests require you to provide attachment files, such as RefundPricing. You can upload files using the UploadAttachmentFile Api. After successful file upload, the Api returns the corresponding file ID, which corresponds to a unique file. When any other interfaces need to use this file, you only need to provide the corresponding file ID.
Note To prevent abuse of the Api, the size of a single file should be less than 5MB, and you can upload up to 5000 files per day.
Note This Api provides Postman collections, and you can contact your account manager to obtain the corresponding collections.

1.2 Target Reader#

The UploadAttachmentFile Api documentation is intended for website developers, maintainers, and managers who have a certain level of website development skills, are familiar with one of the mainstream programming languages such as Java, Python, ASP.NET, PHP, Node.js, and have a basic understanding of the HTTP network protocol.

1.3 Character encoding#

The character encoding for this Api is unified as UTF-8.

1.4 URLs#

EnvironmentURL
Test Environmenthttp://api.pkfare.com/uploadAttachmentFile
Prod environmenthttp://{{apiHost}}/uploadAttachmentFile
NotesThe production environment URL will be provided after you have completed the Api development and testing, and before the official launch. You can replace the "{{apiHost}}" in the production environment URL with the provided domain name.

1.5 Http Method#

POST

1.6 Request Header#

keyvalue
Content-Typemultipart/form-data

1.7 Response Header#

keyvalue
Content-Typeapplication/json

2 Request#

2.1 Schema#

namedescriptiontype
paramThe value after Base64 encoding the Basic Request. The Basic Request is a JSON-structured data, and the detailed explanation is provided in the following text.Text
fileThe file to be uploaded. Supported file types: docx, pdf, gif, png, jpeg, zip, rar. The file size should be less than 5MB.File

2.1.1 Basic Request#

Sample
{
    "authentication": {
        "partnerId": "sVSX7PfsCD7M4=",
        "sign": "e707b5d9dae8459065d"
    }
}
nametyperequireddescription
authenticationObjectyesIdentity information, refer to 2.1.2.

2.1.2 Authentication#

nametyperequireddescription
partnerIdStringyespartnerID
signStringyesSignature, refer to sections 4.1 and 4.2 for the signature method.

2.2 Example of Request Construction Process#

2.2.1 Construct Basic Request in JSON#

{
    "authentication": {
        "partnerId": "sVCD7M4=",
        "sign": "e707b5d9da1bd"
    }
}

2.2.2 Base64 transcode the Basic Request#

ogICAgImF1dGhlbnRpY2F0aW9uIjogewogICAgICAgICJwYXJ0bmVySWQiOiAiUmtzVlNYN1BmWm1XWXNDRDdNND0iLAogICAgICAgICJzaWduIjogIjE3ZTcwN2I1ZDlkYWU4NDU5MDY1ZGJiMTM5ZTVmMWJkIgogICAgfQp9

2.2.3 Attach the file to be uploaded and send the request#

image.png

3 Response#

3.1 Sample#

Data will be return in Json.
Response sample in the case of success:
{
    "errorCode": "0",
    "errorMsg": "ok",
    "data": {
        "fileId": "1ee71d50b4d59ef3e1555729c11745eb",
        "fileName": "Pkfarer.jpg"
    }
}
Response sample in the case of failure:
{
    "errorCode": "B139",
    "errorMsg": "File is oversize. It should be less than 5MB."
}

3.2 Schema#

3.2.1 Basic parameters#

nametypedescriptionsample
errorCodeStringerror code,refer to 5.10
errorMsgStringerror messageok
dataObjectThe returned data, this parameter is not empty only when the error code returns "0", refer to section 3.2.2.-

3.2.1 Data#

nametypedescriptionsample
fileIdStringFile ID. A file ID corresponds to a unique file. When any other interface needs to use this file, you only need to provide the corresponding file ID. The length of the file ID is within 128.1ee71d50b4d59ef3e1555729c11745eb
fileNameStringFile name.Pkfarer.jpg

4 Signature#

4.1 The parameters involved in signature#

partnerId,partnerKey

4.2 Signature#

MD5 encrypt the combination of partnerId and partnerKey.
Sign = MD5(partnerId+partnerKey)。
Sample
partnerId: abcdefg123456
partnerKey: jkHKhkikdhy258dffj
Sign = MD5(abcdefg12ikdhy258dffj) = d7e99ae9d5cd071e3ca08

5 Appendix#

5.1 Error Code List#

error codeerror messagedescription
0oksuccess
S001System errorSystem error
P001Invalid authenticationInvalid authentication
P006Wrong parameterWrong parameter
B002Partner is not existsPartner does not exist
B003Illegal signIllegal signature
B139File is oversize. It should be less than 5MB.The file exceeds the size limit.
B151Upload files allowance is less than 5000 files per day.Exceeded the daily limit of upload times
Modified at 2025-02-24 02:16:25
Previous
CheckReimbursed
Next
DownloadAttachmentFile