Open igorsantos07 opened 7 years ago
The spec could be as follows:
This should be a simple GET
call, as it's only a retrieval of information but in a different format.
It could be implemented as any or as all of the following:
GET /contact/:id.vcf
GET /contact:id
with the header Accept: text/vcard
It must respond with Content-type: text/vcard
, in plain-text.
Here's an example template of the "required" vCard file. Variables are comprised by dollar signs, as $name$
:
BEGIN:VCARD
VERSION:4.0
N:$last_name$;$first_name$;;$title$
FN:$first_name$ $last_name$
EMAIL:$email$
ADR;TYPE=HOME,PREF:;;$number$ $street$;$addr_line_2$;$state$;$postal_code$;$country$
END:VCARD
This is a valid proposal, specially for XML. I'm just not sure if this should be required for an initial version.
Maybe this could be an optional requirement, although I see it's quite important to understand how different APIs would deal with a specific mime-type request, such as when exporting data.
I agree. What mime-types do you think we should require? I believe JSON, XML and CSV are the most important ones.
Given the repository main subject (contacts and addresses), I think it would fit quite well here if we ask for a vCard endpoint, like
GET /contact/:id.vcf
. Additional details on the format can be found at the wikipedia page, but something simple should be required to keep the focus on the API and implementation parts.