Public
Documentation Settings

B1G1 APIs

Welcome to the B1G1 API documentation!

You can use our APIs to add your Giving Stories to the Giving Cart. In future, we will be expanding our public APIs to allow you to add Favourite Projects to the Giving Cart, as well as access and update all your Giving Stories and Favourite Projects.

All responses from the APIs are in JSON. You can view code examples in cURL or your preferred language using the dropdown on the right.

At the moment, all our APIs are available and accessible to B1G1 members for free, and we are actively seeking feedback and suggestions to inform development efforts.

We hope that what we build helps you embed giving into the heart of your business more effectively. And we can't wait to see how you’ll use these APIs to create more impact in the world than anyone has ever imagined.

If you have any feedback or suggestions about our APIs, please reach out to us at team@b1g1.com.

POSTAdd Giving Story to Cart

https://api.b1g1.com/cart/post/<encoded ID of Giving Story>

This endpoint adds a specific Giving Story to your company's Giving Cart using the POST method.

Here's how to retrieve the URL of the endpoint from your B1G1 account:

Once you have successfully added your Giving Story to the Cart, the API will also send back a payload of the details of the Story you have just added.

Errors

Errors could occur if:

  • Your B1G1 account is no longer active (blocked, suspended, or deactivated) -> please reach out to the B1G1 team at team@b1g1.com.
  • The Giving Story is deleted or otherwise no longer available -> please verify that the Giving Story is still in your B1G1 account and that you used the correct endpoint URL.
  • The Project in the Giving Story is delisted or otherwise no longer available -> please change the project within your Giving Story or use another Giving Story instead.
Example Request
curl
curl --location --request POST 'https://api.b1g1.com/cart/post/c3RvcnktMTAyNTktMTExMi0yMjQxLTM3ODgtUE9TVA='
200 OK
Example Response
json
{
  "status": "Success",
  "message": "Giving Story added successfully",
  "story": {
    "id": 123,
    "user_id": 12345,
    "company_id": 1234,
    "project_id": 3434,
    "impact_level_id": 1212,
    "quantity": 2,
    "story_text": "When we receive feedback on the system, we provide 10 nutritious lunch meals for children in Philippines.",
    "giving_story_image": "https://api.b1g1.com/uploads/giving_story/1314391834156204873.jpg",
    "status": 1,
    "is_created_by": 0,
    "is_private": 0,
    "created_at": "2018-06-10 21:05:28",
    "updated_at": "2019-07-02 14:25:30",
    "icon": "https://api.b1g1.com/uploads/giving_story/156204873.jpg",
    "impact": {
      "id": 1122,
      "project_id": 3434,
      "old_projID": null,
      "impact_level_title": "Provide lunch meals/week",
      "impact_level_cost": 1.65,
      "impact_unit": 5,
      "impact_description": "Help end hunger by feeding a child in Philippines. There are about 15 million Filipino children who face the threat of not realising their full potential  not growing to be as tall, as healthy, nor as bright as they can be  because they are suffering from hunger today as they grow up. Our kitchens cook daily nutritious lunch meals for children in public schools, in the streets, and in conflict areas to end hunger and malnutrition.",
      "impact_category_group": null,
      "status": "active",
      "created_at": "2018-05-15 19:25:52",
      "updated_at": null
    }
  },
  "cart_detail": {
    "amt_total_usd": 3.3,
    "quantity": 1,
    "beneficiaries": 10
  },
  "impact_level_cost": 1.65
}
Date

Tue, 02 Jul 2019 06:28:39 GMT

Content-Type

application/json

Transfer-Encoding

chunked

Connection

keep-alive

Cache-Control

no-cache, private

Set-Cookie

b1g1_session=eyJpdiI6Ikd4MWhCRFwvc2NmXC9VVDhBdnE3Z0FlUT09IiwidmFsdWUiOiIza253MXF4QVl0ZzZZNTBcL2c4eVM2aGFOVXpqSzBtR1YyMElBaEVLd2lpSmtPSUJNbEt5YnowMzNFUFJua3ZHYjdabmRcL1N3MHo1MlpvV2x3bHpSY1Z3PT0iLCJtYWMiOiI1OGExOWZhMWZhOGNkNjA4NTFmOWM2Mzc1ZjNhMzc3MjZkNzk0ZjE3MTJiZWExODU3NjQ5NmJhYzY5ODJiMTQ0In0%3D; expires=Tue, 02-Jul-2019 08:28:39 GMT; Max-Age=7200; path=/; httponly

Content-Encoding

gzip

Expect-CT

max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"

Server

cloudflare

CF-RAY

4efe8f94af0b321a-SIN