# Postman Collection

## Empuls v1 API

## 📄 Introduction <a href="#introduction" id="introduction"></a>

Empuls API is a simple way to access Empuls internal APIs without requiring the user to go through to the web interface. At its core for authentication empuls uses OAuth 2.0 which allows API clients to access protected resources on behalf of a user without requiring the user's credentials. This document describes the API and its usage.

### 🔖 How to use this collection

* Use the **EmpulsAPI v1** postman environment.
* Enter `base_url` variable. This is usually the URL of the Empuls portal. ie. `https://abc.xoxoday.com`
* Enter the credentials provided by empuls team in `client_id, client_secret, refresh_token` variables.
* Enter the email of the user you want to use the services as in the `as_user` variable.
* Save the environment using `ctrl+s` or `cmd+s`.
* Run the `Authentication/Company Access Token` endpoint to generate access\_token. This access\_token will be automatically used in the Services APIs

***

### Authentication

The Empuls OAuth authentication flow consists of the following steps:

* The empuls internal team will generate and share the Client ID, Client Secret, and Refresh Token with the user.
* Use the given credentials to fetch Access Token using the `/chef/v1/oauth/token/company` endpoint
* Send the Access Token in the Authorization header as `Bearer` for all the Sevices API
* Send the email of the person you want to access the resources in `as_user` header.

You must include `Authorization` and `as_user` request header in each request to the Empuls API.

Point to note :

* The access token will be valid for 1 day
* The refresh token will be valid for 60 days
* Each time an Access token is generated, the Refresh token expiration date is extended 60 days from that time

In this collection, we store Access Token/Hash and other variables in the environment and automatically use them as necessary.

#### Authentication error response

If an API key is missing, malformed, or invalid, you will receive an HTTP 401 Unauthorized response code.

#### 503 response

An HTTP `503` response from our servers indicates there is an unexpected spike in API access traffic. The server is usually operational within the next five minutes.

AuthorizationBearer TokenToken{{access\_token}}

### Authentication

This endpoint lets users generate Access Token to use for authentication

AuthorizationBearer TokenThis folder is using an authorization helper from the collection Empuls v1 API

#### POSTGet Company Access Token

[Open Request](https://www.postman.com/soujanyaxoxo/request/6243704-864933b8-6289-448d-b68a-9848f6288cc2){{base\_url}}/chef/v1/oauth/token/company

Gets information about the authenticated user.

Bodyraw (json)json

```json
{
    "client_id": "{{client_id}}",
    "client_secret":"{{client_secret}}",
    "refresh_token":"{{refresh_token}}",
    "grant_type":"refresh_token"
}
```

### Services

Services Collection contains all the available services accessible via API

AuthorizationBearer TokenThis folder is using an authorization helper from the collection Empuls v1 API

### Appreciation

AuthorizationBearer TokenThis folder is using an authorization helper from the collection Empuls v1 API

#### POSTSend Award

[Open Request](https://www.postman.com/soujanyaxoxo/request/6243704-5cd8ac26-f8b7-45df-96e5-7bada2886a0b){{base\_url}}/chef/api/sdk/award.mutation.sendAwardAuthorizationBearer TokenThis request is using an authorization helper from collection Empuls v1 APIRequest Headersas\_user{{as\_user}}Bodyraw (json)json

```json
{
    "award_id":"id of the award",
    "recipients":["user1@test.com","user2@test.com"],
    "citation_message":"citation message for the award",
    "points": 0,
    "budget_id":"id of the budget from which the points will be deducted",
    "group_id":"id of the group where the feed will be posted"
}
```

#### POSTSend Appreciation

[Open Request](https://www.postman.com/soujanyaxoxo/request/6243704-3fef2f16-5056-4550-9f69-6c65f04f6387){{base\_url}}/chef/api/sdk/award.mutation.sendAppreciationAuthorizationBearer TokenThis request is using an authorization helper from collection Empuls v1 APIRequest Headersas\_user{{as\_user}}Bodyraw (json)json

```json
{
    "hashtag":"#AppreciationName",
    "recipients":["user1@test.com","user2@test.com"],
    "citation_message":"citation message for the award",
    "group_id":"id of the group where the feed will be posted"
}
```

### Gifting

AuthorizationBearer TokenThis folder is using an authorization helper from collection Empuls v1 API

#### POSTSend Gift

[Open Request](https://www.postman.com/soujanyaxoxo/request/6243704-ca2649d5-5ce5-40a0-a44f-82bbadbc80c1){{base\_url}}/chef/api/sdk/gift.mutation.sendGiftAuthorizationBearer TokenThis request is using an authorization helper from collection Empuls v1 APIRequest Headersas\_user{{as\_user}}Bodyraw (json)View Morejson

```json
{
    "gift_id":"id of the gift",
    "recipients":["user1@test.com","user2@test.com"],
    "condition":"optional use instead of recipients. sending both will result in error",
    "points":0
}
```

### Webview

AuthorizationBearer TokenThis folder is using an authorization helper from collection Empuls v1 API

#### GETWebview

[Open Request](https://www.postman.com/soujanyaxoxo/request/6243704-e9be426e-fe9d-4fc3-ae65-62f1422b0a28){{base\_url}}/chef/api/webview?authorization={{access\_token}}\&as\_user={{as\_user}}\&landing\_page=appreciation\&timestamp={{timestamp}}\&hash={{hash}}Query Paramsauthorization{{access\_token}}as\_user{{as\_user}}landing\_pageappreciationtimestamp{{timestamp}}hash{{hash}}

### Reporting

AuthorizationBearer TokenThis folder is using an authorization helper from collection Empuls v1 API

#### POSTAward Reports

[Open Request](https://www.postman.com/soujanyaxoxo/request/6243704-f9505960-e22f-4841-908f-9150b7f9058f){{base\_url}}/chef/api/sdk/admin\_reports.query.award\_queryAuthorizationBearer TokenThis request is using an authorization helper from collection Empuls v1 APIBodyraw (json)json

```json
{
    "limit": 10,
    "offset": 0,
    "start_date": "2023-04-21",
    "end_date": "2020-05-21",
    "timezone": "+05:30",
    "sorting": "fdc:desc",
    "filters":"{}"
}
```

#### POSTBudget Reports

[Open Request](https://www.postman.com/soujanyaxoxo/request/6243704-bd949da1-60c4-4a23-98b0-1f583fcc83ca){{base\_url}}/chef/api/sdk/admin\_reports.query.budget\_points\_queryAuthorizationBearer TokenThis request is using an authorization helper from collection Empuls v1 APIBodyraw (json)json

```json
{
    "limit": 10,
    "offset": 0,
    "start_date": "2023-04-21",
    "end_date": "2020-05-21",
    "timezone": "+05:30",
    "filters":"{}"
}
```

#### POSTBudget Transaction

[Open Request](https://www.postman.com/soujanyaxoxo/request/6243704-ec2adcf2-447c-495e-b79c-afa9d21f6941){{base\_url}}/chef/api/sdk/admin\_reports.query.budget\_transactions\_queryAuthorizationBearer TokenThis request is using an authorization helper from collection Empuls v1 APIBodyraw (json)json

```json
{
    "limit":10,
    "offset":0,
    "start_date":"2023-01-07",
    "end_date":"2020-02-06",
    "timezone":"+05:30",
    "filters":"{}"
}
```

#### POSTConversation Reports

[Open Request](https://www.postman.com/soujanyaxoxo/request/6243704-d4ffab7f-eeeb-4311-99ca-a06ef087557f){{base\_url}}/chef/api/sdk/admin\_reports.query.conversation\_queryAuthorizationBearer TokenThis request is using an authorization helper from collection Empuls v1 APIBodyraw (json)json

```json
{
    "limit": 10,
    "offset": 0,
    "start_date": "2023-01-07",
    "end_date": "2023-02-06",
    "timezone": "+05:30",
    "sorting": "cat:desc",
    "filters":"{}"
}
```

#### POSTCore Value Reports

[Open Request](https://www.postman.com/soujanyaxoxo/request/6243704-2b924bba-1209-4fc4-9f16-7e90a9179e94){{base\_url}}/chef/api/sdk/admin\_reports.query.corevalue\_queryAuthorizationBearer TokenThis request is using an authorization helper from collection Empuls v1 APIBodyraw (json)json

```json
{
    "limit": 10,
    "offset": 0,
    "start_date": "2023-01-08",
    "end_date": "2023-02-07",
    "timezone": "+05:30",
    "filters":"{}"
}
```

#### POSTGift Reports

[Open Request](https://www.postman.com/soujanyaxoxo/request/6243704-6b9f7dbc-999d-4892-a053-c45fe7d377f7){{base\_url}}/chef/api/sdk/admin\_reports.query.gift\_queryAuthorizationBearer TokenThis request is using an authorization helper from collection Empuls v1 APIBodyraw (json)json

```json
{
    "limit": 10,
    "offset": 0,
    "start_date": "2023-01-08",
    "end_date": "2023-02-07",
    "timezone": "+05:30",
    "sorting": "fed:desc",
    "filters":"{}"
}
```

#### POSTLeaderboard Reports

[Open Request](https://www.postman.com/soujanyaxoxo/request/6243704-1538bb0c-8a27-49f8-a9fa-8183ce44daec){{base\_url}}/chef/api/sdk/admin\_reports.query.leaderboard\_queryAuthorizationBearer TokenThis request is using an authorization helper from collection Empuls v1 APIBodyraw (json)json

```json
{
    "limit": 10,
    "offset": 0,
    "start_date": "2023-01-08",
    "end_date": "2023-02-07",
    "timezone": "+05:30",
    "filters":"{}"
}
```

#### POSTLogin Reports

[Open Request](https://www.postman.com/soujanyaxoxo/request/6243704-51071ee7-a371-4d31-a707-10ba58447185){{base\_url}}/chef/api/sdk/admin\_reports.query.engagement\_queryAuthorizationBearer TokenThis request is using an authorization helper from collection Empuls v1 APIBodyraw (json)json

```json
{
    "limit": 10,
    "offset": 0,
    "start_date": "2023-01-08",
    "end_date": "2023-02-07",
    "timezone": "+05:30",
    "filters":"{}"
}
```

#### POSTNomination Reports

[Open Request](https://www.postman.com/soujanyaxoxo/request/6243704-9ef776f5-c31e-410a-bab2-fb1136b69e5a){{base\_url}}/chef/api/sdk/admin\_reports.query.nomination\_queryAuthorizationBearer TokenThis request is using an authorization helper from collection Empuls v1 APIBodyraw (json)json

```json
{
    "limit": 10,
    "offset": 0,
    "start_date": "2023-01-08",
    "end_date": "2023-02-07",
    "timezone": "+05:30",
    "sorting": "days_since:asc",
    "filters":"{}"
}
```

#### POSTRedemption Reports

[Open Request](https://www.postman.com/soujanyaxoxo/request/6243704-bf12d034-3e79-489b-9489-3669045522c6){{base\_url}}/chef/api/sdk/admin\_reports.query.redemption\_queryAuthorizationBearer TokenThis request is using an authorization helper from collection Empuls v1 APIBodyraw (json)json

```json
{
    "limit": 10,
    "offset": 0,
    "start_date": "2023-01-08",
    "end_date": "2023-02-07",
    "timezone": "+05:30",
    "sorting": "fdc_utc:desc",
    "filters":"{}"
}
```

#### POSTReward Point Expiry Reports

[Open Request](https://www.postman.com/soujanyaxoxo/request/6243704-ed0d5793-befa-49e1-ae76-9bb12c08b23e){{base\_url}}/chef/api/sdk/admin\_reports.query.point\_expiry\_queryAuthorizationBearer TokenThis request is using an authorization helper from collection Empuls v1 APIBodyraw (json)json

```json
{
    "limit": 10,
    "offset": 0,
    "start_date": "2023-01-08",
    "end_date": "2023-02-07",
    "timezone": "+05:30",
    "sorting": "date_created:desc",
    "filters":"{}"
}
```

#### POSTSurvey Reports

[Open Request](https://www.postman.com/soujanyaxoxo/request/6243704-f9623b2b-5613-44b9-9c6b-f1ec3366264a){{base\_url}}/chef/api/sdk/insightReport.query.getSurveyDataListAuthorizationBearer TokenThis request is using an authorization helper from collection Empuls v1 APIBodyraw (json)json

```json
{
    "limit": 10,
    "offset": 0,
    "start_date": "2023-01-08",
    "end_date": "2023-02-07",
    "timezone": "+05:30",
    "filters":"{}"
}
```

### UserProfile

AuthorizationBearer TokenThis folder is using an authorization helper from collection Empuls v1 API

#### POSTFetch User Profile

[Open Request](https://www.postman.com/soujanyaxoxo/request/6243704-91ed665e-5e74-4ea1-8d30-dd31734eb169){{base\_url}}/chef/api/sdk/profile.query.getProfileAuthorizationBearer TokenThis request is using an authorization helper from collection Empuls v1 APIBodyraw (json)View Morejson

```json
{
    "fields": [
        "high_priority_actions",
        "survey_quiz_invites",
        "my_profile",
        "notifications",
        "awards_achievements_received",
        "award_approval_requests"
    ],
    "limit": 10,
    "offset": 0
}
```

### Feeds

AuthorizationBearer TokenThis folder is using an authorization helper from collection Empuls v1 API

#### POSTFetch Feeds

[Open Request](https://www.postman.com/soujanyaxoxo/request/6243704-fc5b36a7-1c0c-4aa1-b03e-91c02af95222){{base\_url}}/chef/api/sdk/feed.query.getFeedAuthorizationBearer TokenThis request is using an authorization helper from collection Empuls v1 APIBodyraw (json)json

```json
{
    "group_id":"1686164069300-ecbd6cd6-d061-40ad-b35d-1da72568262d",
    "type": ["appreciate","awards"],
    "fetch_pinned_posts_only": true,
    "limit": 10,
    "offset": 0
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://xoxoday.gitbook.io/empuls/resources/postman-collection.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
