I Pledge for Peace - API Documentation

The "I Pledge for Peace" project aims to promote peace through public pledges made by individuals. By allowing users to submit pledges in text, video, or picture formats, the initiative seeks to foster a community of peace advocates who publicly declare their commitment to peaceful coexistence. These pledges can be displayed on various websites using a simple API, making it easy to share and spread the message of peace across the internet.

Placeholder 500x500

1. How to Integrate the API on Your Website

To display pledges on your website, you need to include a few lines of HTML and JavaScript. The API is versatile and can be used to display text, video, or picture pledges. Here’s how you can integrate it:

  • Include the widget script in your HTML file:
    <script src="https://pledge.w3-multimedia.com/public/assets/js/pledge-widget.js"></script>
  • Add a div element to your HTML where you want the pledges to appear, with appropriate data attributes depending on the type of pledge (text, video, or picture):
    <div id="pledgeContainer" data-type="text" data-interval="5000"></div>

Here's an example of how to display different types of pledges on your site:

Placeholder 500x500

1. Text Pledge API

<div id="pledgeTextContainer" data-type="text" data-interval="5000"></div>

2. Video Pledge API

<div id="pledgeVideoContainer" data-interval="9000" data-type="video"></div>

3. Picture Pledge API

<div id="pledgePictureContainer" data-interval="9000" data-type="picture"></div>

2. How to Add a Pledge

To add a pledge, users must visit a unique URL where they can fill out a form. The form requires the following fields:

  • Name: The name of the person making the pledge.
  • Ghana Card Number: A unique identifier for the person.
  • Pledge Type: The type of pledge (text, video, or picture).

Once the user submits the form, the pledge goes to an administrator for approval before being displayed publicly.

The form can be accessed at the following URL: https://pledge.w3-multimedia.com/submit-pledge.

Placeholder 500x500

Example Submission Process

When users visit the form URL, they will see fields to enter their name, Ghana Card number, and to select the type of pledge they wish to make. Depending on the selection:

  • Text: The user will enter their pledge message in a text field.
  • Video: The user will be prompted to upload a video file containing their pledge.
  • Picture: The user will be prompted to upload an image file containing their pledge.

After submitting the form, the pledge is queued for review. If approved by the administrator, it will be published and made available for display on websites that have integrated the API.

Placeholder 500x500

3. The Approval Stage

After a pledge is submitted, it will not immediately appear on websites. Each pledge goes through an approval process by an administrator. The administrator reviews the content to ensure it aligns with the goals of the "I Pledge for Peace" campaign. Once approved, the pledge will be displayed publicly on participating websites.

Administrators can approve pledges through the admin panel provided by the platform. Only approved pledges will be accessible via the API and displayed on integrated websites.

Placeholder 500x500