Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • Show us your code or it will be pretty hard for us to know if you missed something. Note: The pass-file is most likely a binary file, which means that you need to encode the content using base64 or similar before you can send it as a string to an API. Commented May 30, 2018 at 12:14
  • Added method that return response.
    – Praveen D
    Commented May 30, 2018 at 12:39
  • $file = file_get_contents($paths['pkpass']); return content but that can not be handeled in api response.
    – Praveen D
    Commented May 30, 2018 at 12:40
  • Like I said, you need to encode the data before sending it to an API. $file = base64_encode($file);. Then the API needs to decode it, using $content = base64_decode($theEncodedData);. XML is a text-format. You can't send binary data in XML. Commented May 30, 2018 at 13:05
  • Where are you making the API call? I only see you outputting the contents? Commented May 30, 2018 at 13:08