Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What uses Passbook's Logging Endpoint?

Tags:

ios

ios6

passbook

I'm just beginning the implementation of my Web Service for passbook.

In the docs I see there's an optional endpoint for logs, but don't understand what uses/consumes this endpoint?

As far as I can tell, it's only used by humans who wish to check the logs.

For clarity, Apple's docs say the logs should be accessible via a

POST request to webServiceURL /version /log

but I can't see why we couldn't use a GET request to webServiceURL/version/myAppsLogs

like image 433
Ev. Avatar asked Sep 27 '12 00:09

Ev.


2 Answers

According to the specification, Passbook will POST a JSON document to your logging endpoint. GET wouldn't allow submitting data. This JSON document will only have one key "logs" which is an array of strings. You need to respond only with an HTTP 200 status.

A sample communication would look like this:

POST /yourwebServiceURL/v1/log HTTP/1.1
Host: yourserver
Content-Type: application/json
Content-Length: 83

{
  "logs" : [
    "log message 1",
    "log message 2",
    "log message n"
  ]
}

HTTP/1.1 200 OK
Connection: Close
like image 129
Martin Avatar answered Sep 28 '22 08:09

Martin


Passbook itself uses this url if it finds an error in the pass, or in your implementation of the api. I definitely recommend logging everything that comes through this url, the errors are pretty comprehensive, and it helped me find some problems I didn't know that I had.

like image 45
Nathan Avatar answered Sep 28 '22 07:09

Nathan