Skip to content
This repository was archived by the owner on Aug 22, 2019. It is now read-only.

Assertions

brianlovesdata edited this page Sep 9, 2011 · 32 revisions

Signed

In the future we will support signed assertions, which will mean signing a badge assertion with your private key and hosting a public key at a well known, public URL. In the even more distant future, we will probably try to support DNSSEC for public key discovery. For now, we only support Hosted Assertions.

Hosted

A hosted assertion is a file containing well-formatted JSON served with the content-type application/json.

Setting Content-Type

PHP

Do this before doing anything that starts a response (echo, print, etc.)

header('Content-Type: application/json');

Django

badge_manifest_json should be already be a JSON string.

HttpResponse(badge_manifest_json, mimetype='application/json')

Rails

badge_manifest is your hash containing the badge data. This will automatically convert it to JSON for you.

render :json => badge_manifest

Apache

If you're hosting your assertions statically, save them as .json files and add the following line to your httpd.conf

AddType application/json        json

Nginx

In your server context, add the following:

types {
  applications/json     json;
}

Read http://wiki.nginx.org/HttpCoreModule#types for more information.

Clone this wiki locally