Skip to content

Commit

Permalink
Merge pull request #169 from vinkoS993/main
Browse files Browse the repository at this point in the history
Docs for endpoint to get project credit balance and for social service
  • Loading branch information
dimitrov-d authored Apr 2, 2024
2 parents 3986910 + 5d0d51c commit fc9d84d
Show file tree
Hide file tree
Showing 2 changed files with 517 additions and 10 deletions.
70 changes: 60 additions & 10 deletions build/1-apillon-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,21 @@ These permissions could be assigned to an API key for every attached service (e.

If a request is made with an API key that lacks permission for a called endpoint, the following errors can occur:

| Status | Message | Description |
| ------ | --------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 403 | Insufficient permissions - missing `permission name` permission | API key lacks required permission for called service. |
| Status | Message | Description |
| ------ | --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 403 | Insufficient permissions - missing `permission name` permission | API key lacks required permission for called service. |
| 403 | Insufficient permissions to access this record | API key has required permissions for endpoint, but it does not have the right to access the addressed record (i.e., a record belongs to a different project). |

### Listing requests

Endpoints starting with "List" are intended to list different data, where the response contains the below properties.

| Name | Description |
| ----- | ------------------------------------------------------- |
| items | Records on a specified page that match the current query|
| total | Number of all records that match the query |
| limit | Number of items on a page (default: 20). |
| page | Current page |
| Name | Description |
| ----- | -------------------------------------------------------- |
| items | Records on a specified page that match the current query |
| total | Number of all records that match the query |
| limit | Number of items on a page (default: 20). |
| page | Current page |

Listing endpoints by default supports the query parameters below:

Expand Down Expand Up @@ -238,6 +238,56 @@ If a project's credit balance is lower than price of executed action, API will r
}
```

## Project

Api key is created inside a project and can be used to get project details through Apillon API.

### Credit balance

> API to get project credit balance
<CodeDiv>GET /project/credit</CodeDiv>

<div class="split_content">
<div class="split_side">

#### Response fields

| Name | Type | Description |
| ------- | -------- | ---------------------------------------------------------------------------------------------------- |
| balance | `number` | Current credit balance - amount of credits in project, that can be used to perform different actions |

</div>
<div class="split_side">
<br>
<CodeGroup>
<CodeGroupItem title="cURL basic" active>

```sh
curl --location --request GET "https://api.apillon.io/project/credit" \
--header "Authorization: Basic :credentials"
```

</CodeGroupItem>
</CodeGroup>
<CodeGroup>
<CodeGroupItem title="Response">

```json
{
"id": "ec700ddd-4a0d-4d6d-b3ba-64b7ab031c4b",
"status": 200,
"data": {
"balance": 120
}
}
```

</CodeGroupItem>
</CodeGroup>
</div>
</div>

## API Code Examples

Examples for using the Apillon API in PHP, .NET (C#) and Python can be found on [our code examples github repo](https://github.com/Apillon/code-examples)
Examples for using the Apillon API in PHP, .NET (C#) and Python can be found on [our code examples github repo](https://github.com/Apillon/code-examples)
Loading

0 comments on commit fc9d84d

Please sign in to comment.