Show/hide Table of Contents

Karani API

Authentication

To access the endpoints of this API, you need to obtain an API key. Please follow the steps below to acquire your API key:

  1. Request API Key

    • Head over to https://karani.co/account/services.
    • Click on the Get Key button
    • On success, you will receive an API key in the response.
  2. Include API Key in Requests

    • For all subsequent requests to the API, you must include the API key parameters: https://karani.co/api/v1/contacts?key=MYKEY

API Key Errors

In case of any errors while acquiring the API key, you will receive an error response with the appropriate status code and message. Please refer to the error handling section for more details.

API Errors

All errors are reported with the same data shapes.

  • Description: Error handling for retrieving contacts.
  • Error Responses:

    • Status Code: 401 (Unauthorized)
    • Response Body: { "success": false, "message": "Unauthorized", "data": [] ]
    • Status Code: 403 (Forbidden)
    • Response Body: { "success": false, "message": "Unauthorized", "data": [] ]

    • Status Code: 404 (Not Found)

    • Response Body: { "success": false, "message": "Not Found", "data": [] ]

Contacts

GET api/v1/contacts

Success

  • Description: Retrieve a list of all contacts.
  • Method: GET
  • URL: https://karani.co/api/v1/contacts
  • Success Response:
    • Status Code: 200 (OK)
    • Response Body: { "success": true, "message": "", "data": [ { "id": 1, "name": "John Doe", "email": "[email protected]" // Additional contact properties }, // Additional contacts ] ]

POST api/v1/contacts

Success

  • Description: Create a new contact.
  • Method: POST
  • URL: https://karani.co/api/v1/contacts
  • Request Body: { "name": "Jane Smith", "email": "[email protected]" // Additional contact properties }
  • Success Response:
    • Status Code: 201 (Created)
    • Response Body: { "id": 2, "name": "Jane Smith", "email": "[email protected]" // Additional contact properties }

GET api/v1/contacts/{id}

Success

  • Description: Retrieve details of a specific contact by ID.
  • Method: GET
  • URL: https://karani.co/api/v1/contacts/{id}
  • Success Response:
    • Status Code: 200 (OK)
    • Response Body: ``` { "id": 1, "name": "John Doe", "email": "[email protected]" // Additional contact properties }

```

PUT api/v1/contacts/{id}

Success

  • Description: Update contact.
  • Method: PUT
  • URL: https://karani.co/api/v1/contacts/{id}
  • Request Body: { "name": "Jane Smith", "email": "[email protected]" }
  • Success Response:
    • Status Code: 201 (Created)
    • Response Body: { "id": 2, "name": "Jane Smith", "email": "[email protected]" // Additional contact properties }

Gifts

GET api/v1/gifts

Success

  • Description: Retrieve a list of all gifts.
  • Method: GET
  • URL: https://karani.co/api/v1/gifts
  • Success Response:
    • Status Code: 200 (OK)
    • Response Body: { "success": true, "message": "", "data": [ { "id": 1, "name": "John Doe", "email": "[email protected]" // Additional gift properties }, // Additional gifts ] ]

POST api/v1/gifts

Success

  • Description: Create a new gift.
  • Method: POST
  • URL: https://karani.co/api/v1/gifts
  • Request Body: { "name": "Jane Smith", "email": "[email protected]" // Additional gift properties }
  • Success Response:
    • Status Code: 201 (Created)
    • Response Body: { "id": 2, "name": "Jane Smith", "email": "[email protected]" // Additional gift properties }

GET api/v1/gifts/{id}

Success

  • Description: Retrieve details of a specific gift by ID.
  • Method: GET
  • URL: https://karani.co/api/v1/gifts/{id}
  • Success Response:
    • Status Code: 200 (OK)
    • Response Body: ``` { "id": 1, "name": "John Doe", "email": "[email protected]" // Additional gift properties }

```

PUT api/v1/gifts/{id}

Success

  • Description: Update gift.
  • Method: PUT
  • URL: https://karani.co/api/v1/gifts/{id}
  • Request Body: { "name": "Jane Smith", "email": "[email protected]" }
  • Success Response:
    • Status Code: 201 (Created)
    • Response Body: { "id": 2, "name": "Jane Smith", "email": "[email protected]" // Additional gift properties }

Pledges

GET api/v1/pledges

Success

  • Description: Retrieve a list of all pledges.
  • Method: GET
  • URL: https://karani.co/api/v1/pledges
  • Success Response:
    • Status Code: 200 (OK)
    • Response Body: { "success": true, "message": "", "data": [ { "id": 1, "name": "John Doe", "email": "[email protected]" // Additional pledge properties }, // Additional pledges ] ]

POST api/v1/pledges

Success

  • Description: Create a new pledge.
  • Method: POST
  • URL: https://karani.co/api/v1/pledges
  • Request Body: { "name": "Jane Smith", "email": "[email protected]" // Additional pledge properties }
  • Success Response:
    • Status Code: 201 (Created)
    • Response Body: { "id": 2, "name": "Jane Smith", "email": "[email protected]" // Additional pledge properties }

GET api/v1/pledges/{id}

Success

  • Description: Retrieve details of a specific pledge by ID.
  • Method: GET
  • URL: https://karani.co/api/v1/pledges/{id}
  • Success Response:
    • Status Code: 200 (OK)
    • Response Body: ``` { "id": 1, "name": "John Doe", "email": "[email protected]" // Additional pledge properties }

```

PUT api/v1/pledges/{id}

Success

  • Description: Update pledge.
  • Method: PUT
  • URL: https://karani.co/api/v1/pledges/{id}
  • Request Body: { "name": "Jane Smith", "email": "[email protected]" }
  • Success Response:
    • Status Code: 201 (Created)
    • Response Body: { "id": 2, "name": "Jane Smith", "email": "[email protected]" // Additional pledge properties }

Tasks

GET api/v1/tasks

Success

  • Description: Retrieve a list of all tasks.
  • Method: GET
  • URL: https://karani.co/api/v1/tasks
  • Success Response:
    • Status Code: 200 (OK)
    • Response Body: { "success": true, "message": "", "data": [ { "id": 1, "name": "John Doe", "email": "[email protected]" // Additional task properties }, // Additional tasks ] ]

POST api/v1/tasks

Success

  • Description: Create a new task.
  • Method: POST
  • URL: https://karani.co/api/v1/tasks
  • Request Body: { "name": "Jane Smith", "email": "[email protected]" // Additional task properties }
  • Success Response:
    • Status Code: 201 (Created)
    • Response Body: { "id": 2, "name": "Jane Smith", "email": "[email protected]" // Additional task properties }

GET api/v1/tasks/{id}

Success

  • Description: Retrieve details of a specific task by ID.
  • Method: GET
  • URL: https://karani.co/api/v1/tasks/{id}
  • Success Response:
    • Status Code: 200 (OK)
    • Response Body: ``` { "id": 1, "name": "John Doe", "email": "[email protected]" // Additional task properties }

```

PUT api/v1/tasks/{id}

Success

  • Description: Update task.
  • Method: PUT
  • URL: https://karani.co/api/v1/tasks/{id}
  • Request Body: { "name": "Jane Smith", "email": "[email protected]" }
  • Success Response:
    • Status Code: 201 (Created)
    • Response Body: { "id": 2, "name": "Jane Smith", "email": "[email protected]" // Additional task properties }