JSON-RPC is a light-weight remote procedure call protocol that uses JavaScript Object Notation (JSON) as the data format for requests and responses. You can find more details on this protocol in the JSON-RPC Specification.
Below is an example of a JSON-RPC request and response (in this case, for the LoadPhoto method):
POST /api/1.6/zfapi.asmx HTTP/1.1<cr><lf> Host: www.zenfolio.com<cr><lf> User-Agent: Acme PhotoEdit plugin for Zenfolio<cr><lf> Content-Type: application/json<cr><lf> Content-Length: 75<cr><lf> <cr><lf> { "method": "LoadPhoto", "params": [327977501], "id": 1 }
HTTP/1.1 200 OK<cr><lf> Content-Type: application/json; charset=UTF-8<cr><lf> Content-Length: 938<cr><lf> <cr><lf> { "id": 1, "error": null, "result": { "$type": "Photo", "Id": 327977501, "Width": 878, "Height": 598, "Sequence": "", "Title": "Racoon", "Keywords": [ ], "Categories": [ 1018000, 1000000 ], "Gallery": 492530544, "Size": 482933, "FileName": "14.jpg", "MimeType": "image/jpeg", "UploadedOn": { "$type": "DateTime" "Value": "2006-16-28 08:16:42", }, "TakenOn": { "$type": "DateTime" "Value": "2006-16-28 12:16:42", }, "Views": 0, "OriginalUrl": "/img/v0/p327977501.jpg", "UrlCore": "/img/v0/p327977501", "AccessDescriptor": { "$type": "AccessDescriptor", "RealmId": 180436196, "IsDerived": false, "AccessMask": "ProtectOriginals, ProtectExtraLarge", "AccessType": "Public" }, "IsCensored": false } }
Several important points to keep in mind: