# Strategic Partner's Workplan APIs
> **N.B.: Here is the api documentation for the workplan APIs. There are few more APIs are not documented. If you want those as well please let me know.**
## Create Workplan
- api url: `{{host}}/api/v2/sp-workplans/`
- headers:
```json=
{
"Content-Type": "application/json",
"Authorization": "Bearer {{ACCESS_TOKEN}}"
}
```
- sample request body:
```json=
{
"strategic_partner": 4, // foreign key
"fp_name": "Some Random Name",
"fp_title": "mr",
"suggested_date": "2022-01-01"
}
```
- sample response
```json=
{
"id": 4,
"strategic_partner": {
"id": 4,
"name": "Walmart",
"image": "/static/media/logo/logo_walmart.jpg"
},
"suggested_date": "2022-01-01",
"documents": [],
"main_goals": null,
"progress_indicator": [],
"key_activities": [],
"fp_name": "Some Name",
"fp_title": "mr",
"current_step": "introduction",
"status": "saved",
"created_at": "2022-03-28T09:50:10.480408Z",
"updated_at": "2022-03-28T09:50:10.480447Z",
"pdf_file": null
}
```
### Create Documents
- api url: `{{host}}/api/v2/sp-workplan-docs/`
- headers:
```json=
{
"Content-Type": "multipart/form-data",
"Authorization": "Bearer {{ACCESS_TOKEN}}"
}
```
- sample request body:
```text=
--form 'workplan="1"' \
--form 'document_type="supply_chain"' \
--form 'document=@"/Users/rakibhasanamiya/Downloads/query_result_2022-03-21T05_01_00.137027Z.xlsx"'
```
- sample response:
```json=
{
"id": 13,
"workplan": {
"id": 1,
"strategic_partner": {
"id": 4,
"name": "Walmart",
"image": "/static/media/logo/logo_walmart.jpg"
},
"suggested_date": "2022-01-01",
"created_at": "2022-03-25T05:37:18.878541Z"
},
"document": {
"id": 48,
"name": "query_result_2022-03-21T05_01_00.137027Z.xlsx",
"sort_number": null,
"description": null,
"type": "O",
"file_path": "https://ilm-staging-private.s3.amazonaws.com/media/other/shared/query_result_2022-03-21T05_01_00.137027Z.xlsx?AWSAccessKeyId=AKIAQEWIQRZNUU7RED6M&Signature=ivN8v3s8SI6JrjlmDzZeS4pZjUY%3D&Expires=1648464260",
"created_at": "2022-03-28"
},
"document_type": "supply_chain",
"created_at": "2022-03-28T10:29:20.706696Z",
"updated_at": "2022-03-28T10:29:20.706764Z"
}
```
### Create Main Goals
- api url: `{{host}}/api/v2/sp-workplan-main-goals/`
- headers:
```json=
{
"Content-Type": "application/json",
"Authorization": "Bearer {{ACCESS_TOKEN}}"
}
```
- request body:
```json=
{
"workplan": 2,
"ethical_recruitment": "ethical recruitment",
"partnership_areas": "partnership areas",
"worker_voice_escalation": "worker voice escalation"
}
```
- response:
```json=
{
"id": 9,
"workplan": {
"id": 2,
"strategic_partner": {
"id": 4,
"name": "Walmart",
"image": "/static/media/logo/logo_walmart.jpg"
},
"suggested_date": "2022-01-01",
"created_at": "2022-03-25T05:52:54.621148Z"
},
"ethical_recruitment": "ethical recruitment",
"partnership_areas": "partnership areas",
"worker_voice_escalation": "worker voice escalation",
"created_at": "2022-03-28T10:50:39.727491Z",
"updated_at": "2022-03-28T10:50:39.727606Z"
}
```
### Create Progress Indicator
- api url: `{{host}}/api/v2/sp-workplan-progress-indicators/`
- headers:
```json=
{
"Content-Type": "application/json",
"Authorization": "Bearer {{ACCESS_TOKEN}}"
}
```
- sample request body:
```json=
{
"workplan": 1,
"area": "worker_voice",
"sub_area": "percentage",
"numeric_value": 10
}
```
- sample response:
```json=
{
"id": 1,
"workplan": {
"id": 1,
"strategic_partner": {
"id": 4,
"name": "Walmart",
"image": "/static/media/logo/logo_walmart.jpg"
},
"suggested_date": "2022-01-01",
"created_at": "2022-03-25T05:37:18.878541Z"
},
"area": "worker_voice",
"sub_area": "percentage",
"numeric_value": 10,
"str_value": null,
"txt_value": null,
"created_at": "2022-03-28T10:55:17.016676Z",
"updated_at": "2022-03-28T10:55:17.016842Z"
}
```
### Create Workplan Activity
- api url: `{{host}}/api/v2/sp-workplans/1`
- headers:
```json=
{
"Content-Type": "application/json",
"Authorization": "Bearer {{ACCESS_TOKEN}}"
}
```
- sample request body:
```json=
{
"workplan": 1,
"area": "worker_voice",
"sub_area": "percentage",
"numeric_value": 10
}
```
- sample response:
```json=
{
"id": 1,
"workplan": {
"id": 1,
"strategic_partner": {
"id": 4,
"name": "Walmart",
"image": "/static/media/logo/logo_walmart.jpg"
},
"suggested_date": "2022-01-01",
"created_at": "2022-03-25T05:37:18.878541Z"
},
"area": "worker_voice",
"sub_area": "percentage",
"str_value": null,
"txt_value": null,
"created_at": "2022-03-28T11:02:00.497173Z",
"updated_at": "2022-03-28T11:02:00.497237Z"
}
```
### Get Workplan Details
- api url: `{{host}}/api/v2/sp-workplan-activity/`
- headers:
```json=
{
"Authorization": "Bearer {{ACCESS_TOKEN}}"
}
```
- sample resposne:
```json=
{
"id": 1,
"strategic_partner": {
"id": 4,
"name": "Walmart",
"image": "/static/media/logo/logo_walmart.jpg"
},
"suggested_date": "2022-01-01",
"documents": [
{
"id": 13,
"workplan": {
"id": 1,
"strategic_partner": {
"id": 4,
"name": "Walmart",
"image": "/static/media/logo/logo_walmart.jpg"
},
"suggested_date": "2022-01-01",
"created_at": "2022-03-25T05:37:18.878541Z"
},
"document": {
"id": 48,
"name": "query_result_2022-03-21T05_01_00.137027Z.xlsx",
"sort_number": null,
"description": null,
"type": "O",
"file_path": "https://ilm-staging-private.s3.amazonaws.com/media/other/shared/query_result_2022-03-21T05_01_00.137027Z.xlsx?AWSAccessKeyId=AKIAQEWIQRZNUU7RED6M&Signature=yAKGJvFdn5S8vKLUGs7gEdzD7yY%3D&Expires=1648466337",
"created_at": "2022-03-28"
},
"document_type": "supply_chain",
"created_at": "2022-03-28T10:29:20.706696Z",
"updated_at": "2022-03-28T10:29:20.706764Z"
},
{
"id": 12,
"workplan": {
"id": 1,
"strategic_partner": {
"id": 4,
"name": "Walmart",
"image": "/static/media/logo/logo_walmart.jpg"
},
"suggested_date": "2022-01-01",
"created_at": "2022-03-25T05:37:18.878541Z"
},
"document": {
"id": 47,
"name": "query_result_2022-03-21T05_01_00.137027Z.xlsx",
"sort_number": null,
"description": null,
"type": "O",
"file_path": "https://ilm-staging-private.s3.amazonaws.com/media/other/shared/query_result_2022-03-21T05_01_00.137027Z.xlsx?AWSAccessKeyId=AKIAQEWIQRZNUU7RED6M&Signature=yAKGJvFdn5S8vKLUGs7gEdzD7yY%3D&Expires=1648466337",
"created_at": "2022-03-28"
},
"document_type": "supply_chain",
"created_at": "2022-03-28T10:27:33.790716Z",
"updated_at": "2022-03-28T10:27:33.790791Z"
},
{
"id": 11,
"workplan": {
"id": 1,
"strategic_partner": {
"id": 4,
"name": "Walmart",
"image": "/static/media/logo/logo_walmart.jpg"
},
"suggested_date": "2022-01-01",
"created_at": "2022-03-25T05:37:18.878541Z"
},
"document": {
"id": 46,
"name": "some_name.xlsx",
"sort_number": null,
"description": null,
"type": "O",
"file_path": "https://ilm-staging-private.s3.amazonaws.com/media/other/shared/query_result_2022-03-21T05_01_00.137027Z.xlsx?AWSAccessKeyId=AKIAQEWIQRZNUU7RED6M&Signature=yAKGJvFdn5S8vKLUGs7gEdzD7yY%3D&Expires=1648466337",
"created_at": "2022-03-28"
},
"document_type": "supply_chain",
"created_at": "2022-03-28T10:26:46.069626Z",
"updated_at": "2022-03-28T10:26:46.069684Z"
},
{
"id": 10,
"workplan": {
"id": 1,
"strategic_partner": {
"id": 4,
"name": "Walmart",
"image": "/static/media/logo/logo_walmart.jpg"
},
"suggested_date": "2022-01-01",
"created_at": "2022-03-25T05:37:18.878541Z"
},
"document": {
"id": 45,
"name": "some_name.xlsx",
"sort_number": null,
"description": null,
"type": "O",
"file_path": "https://ilm-staging-private.s3.amazonaws.com/media/other/shared/query_result_2022-03-21T05_01_00.137027Z.xlsx?AWSAccessKeyId=AKIAQEWIQRZNUU7RED6M&Signature=yAKGJvFdn5S8vKLUGs7gEdzD7yY%3D&Expires=1648466337",
"created_at": "2022-03-28"
},
"document_type": "supply_chain",
"created_at": "2022-03-28T10:25:59.267471Z",
"updated_at": "2022-03-28T10:25:59.267525Z"
},
{
"id": 9,
"workplan": {
"id": 1,
"strategic_partner": {
"id": 4,
"name": "Walmart",
"image": "/static/media/logo/logo_walmart.jpg"
},
"suggested_date": "2022-01-01",
"created_at": "2022-03-25T05:37:18.878541Z"
},
"document": {
"id": 44,
"name": "some_name.xlsx",
"sort_number": null,
"description": null,
"type": "O",
"file_path": "https://ilm-staging-private.s3.amazonaws.com/media/other/shared/query_result_2022-03-21T05_01_00.137027Z.xlsx?AWSAccessKeyId=AKIAQEWIQRZNUU7RED6M&Signature=yAKGJvFdn5S8vKLUGs7gEdzD7yY%3D&Expires=1648466337",
"created_at": "2022-03-28"
},
"document_type": "supply_chain",
"created_at": "2022-03-28T10:25:05.811409Z",
"updated_at": "2022-03-28T10:25:05.811475Z"
},
{
"id": 8,
"workplan": {
"id": 1,
"strategic_partner": {
"id": 4,
"name": "Walmart",
"image": "/static/media/logo/logo_walmart.jpg"
},
"suggested_date": "2022-01-01",
"created_at": "2022-03-25T05:37:18.878541Z"
},
"document": {
"id": 4,
"name": "logo_redlobster.jpg",
"sort_number": null,
"description": "Logo Image for partner Red Lobster",
"type": "O",
"file_path": "https://ilm-staging-private.s3.amazonaws.com/media/other/shared/logo_redlobster.jpg?AWSAccessKeyId=AKIAQEWIQRZNUU7RED6M&Signature=uNwooF2PCgpEJ0FITjfohvdrQCA%3D&Expires=1648466337",
"created_at": "2021-04-20"
},
"document_type": "supply_chain",
"created_at": "2022-03-28T10:18:08.857097Z",
"updated_at": "2022-03-28T10:18:08.857167Z"
},
{
"id": 7,
"workplan": {
"id": 1,
"strategic_partner": {
"id": 4,
"name": "Walmart",
"image": "/static/media/logo/logo_walmart.jpg"
},
"suggested_date": "2022-01-01",
"created_at": "2022-03-25T05:37:18.878541Z"
},
"document": {
"id": 4,
"name": "logo_redlobster.jpg",
"sort_number": null,
"description": "Logo Image for partner Red Lobster",
"type": "O",
"file_path": "https://ilm-staging-private.s3.amazonaws.com/media/other/shared/logo_redlobster.jpg?AWSAccessKeyId=AKIAQEWIQRZNUU7RED6M&Signature=uNwooF2PCgpEJ0FITjfohvdrQCA%3D&Expires=1648466337",
"created_at": "2021-04-20"
},
"document_type": "supply_chain",
"created_at": "2022-03-28T10:17:37.827469Z",
"updated_at": "2022-03-28T10:17:37.827504Z"
},
{
"id": 6,
"workplan": {
"id": 1,
"strategic_partner": {
"id": 4,
"name": "Walmart",
"image": "/static/media/logo/logo_walmart.jpg"
},
"suggested_date": "2022-01-01",
"created_at": "2022-03-25T05:37:18.878541Z"
},
"document": {
"id": 43,
"name": "some_name.xlsx",
"sort_number": null,
"description": null,
"type": "IS",
"file_path": "https://ilm-staging-private.s3.amazonaws.com/media/staff/shared/query_result_2022-03-21T05_01_00.137027Z.xlsx?AWSAccessKeyId=AKIAQEWIQRZNUU7RED6M&Signature=ER2MXG%2Bcc1umWG2vA%2FOUICrLQ4k%3D&Expires=1648466337",
"created_at": "2022-03-28"
},
"document_type": "supply_chain",
"created_at": "2022-03-28T10:16:07.043990Z",
"updated_at": "2022-03-28T10:16:07.044121Z"
},
{
"id": 5,
"workplan": {
"id": 1,
"strategic_partner": {
"id": 4,
"name": "Walmart",
"image": "/static/media/logo/logo_walmart.jpg"
},
"suggested_date": "2022-01-01",
"created_at": "2022-03-25T05:37:18.878541Z"
},
"document": {
"id": 42,
"name": "some_name.xlsx",
"sort_number": null,
"description": null,
"type": "O",
"file_path": "https://ilm-staging-private.s3.amazonaws.com/media/other/shared/query_result_2022-03-21T05_01_00.137027Z.xlsx?AWSAccessKeyId=AKIAQEWIQRZNUU7RED6M&Signature=yAKGJvFdn5S8vKLUGs7gEdzD7yY%3D&Expires=1648466337",
"created_at": "2022-03-28"
},
"document_type": "supply_chain",
"created_at": "2022-03-28T10:15:13.354011Z",
"updated_at": "2022-03-28T10:15:13.354068Z"
},
{
"id": 4,
"workplan": {
"id": 1,
"strategic_partner": {
"id": 4,
"name": "Walmart",
"image": "/static/media/logo/logo_walmart.jpg"
},
"suggested_date": "2022-01-01",
"created_at": "2022-03-25T05:37:18.878541Z"
},
"document": {
"id": 41,
"name": "some_name.xlsx",
"sort_number": null,
"description": null,
"type": "O",
"file_path": "https://ilm-staging-private.s3.amazonaws.com/media/other/shared/query_result_2022-03-21T05_01_00.137027Z.xlsx?AWSAccessKeyId=AKIAQEWIQRZNUU7RED6M&Signature=yAKGJvFdn5S8vKLUGs7gEdzD7yY%3D&Expires=1648466337",
"created_at": "2022-03-28"
},
"document_type": "supply_chain",
"created_at": "2022-03-28T10:12:24.133336Z",
"updated_at": "2022-03-28T10:12:24.133394Z"
},
{
"id": 3,
"workplan": {
"id": 1,
"strategic_partner": {
"id": 4,
"name": "Walmart",
"image": "/static/media/logo/logo_walmart.jpg"
},
"suggested_date": "2022-01-01",
"created_at": "2022-03-25T05:37:18.878541Z"
},
"document": {
"id": 1,
"name": "Updated Guide to Ethics and Human Rights in Anti-Trafficking",
"sort_number": 3,
"description": "Rende Taylor, Lisa Maria and M Latonero (2018). Updated Guide to Ethics and Human Rights in Anti-Trafficking: Ethical Standards for Working with Migrant Workers and Trafficked Persons in the Digital Age. Bangkok: Issara Institute",
"type": "SP",
"file_path": "https://ilm-staging-private.s3.amazonaws.com/media/partners/shared/5bf36e_1307f698e5ec46b6b2fc7f4391bff4b6.pdf?AWSAccessKeyId=AKIAQEWIQRZNUU7RED6M&Signature=817PNpzIQo%2BupjT%2F1Sp9EKQD%2BYE%3D&Expires=1648466337",
"created_at": "2021-04-10"
},
"document_type": "supply_chain",
"created_at": "2022-03-25T08:51:38.140393Z",
"updated_at": "2022-03-25T08:51:38.140457Z"
},
{
"id": 2,
"workplan": {
"id": 1,
"strategic_partner": {
"id": 4,
"name": "Walmart",
"image": "/static/media/logo/logo_walmart.jpg"
},
"suggested_date": "2022-01-01",
"created_at": "2022-03-25T05:37:18.878541Z"
},
"document": {
"id": 1,
"name": "Updated Guide to Ethics and Human Rights in Anti-Trafficking",
"sort_number": 3,
"description": "Rende Taylor, Lisa Maria and M Latonero (2018). Updated Guide to Ethics and Human Rights in Anti-Trafficking: Ethical Standards for Working with Migrant Workers and Trafficked Persons in the Digital Age. Bangkok: Issara Institute",
"type": "SP",
"file_path": "https://ilm-staging-private.s3.amazonaws.com/media/partners/shared/5bf36e_1307f698e5ec46b6b2fc7f4391bff4b6.pdf?AWSAccessKeyId=AKIAQEWIQRZNUU7RED6M&Signature=817PNpzIQo%2BupjT%2F1Sp9EKQD%2BYE%3D&Expires=1648466337",
"created_at": "2021-04-10"
},
"document_type": "supply_chain",
"created_at": "2022-03-25T07:47:51.667148Z",
"updated_at": "2022-03-25T07:47:51.667303Z"
},
{
"id": 1,
"workplan": {
"id": 1,
"strategic_partner": {
"id": 4,
"name": "Walmart",
"image": "/static/media/logo/logo_walmart.jpg"
},
"suggested_date": "2022-01-01",
"created_at": "2022-03-25T05:37:18.878541Z"
},
"document": {
"id": 1,
"name": "Updated Guide to Ethics and Human Rights in Anti-Trafficking",
"sort_number": 3,
"description": "Rende Taylor, Lisa Maria and M Latonero (2018). Updated Guide to Ethics and Human Rights in Anti-Trafficking: Ethical Standards for Working with Migrant Workers and Trafficked Persons in the Digital Age. Bangkok: Issara Institute",
"type": "SP",
"file_path": "https://ilm-staging-private.s3.amazonaws.com/media/partners/shared/5bf36e_1307f698e5ec46b6b2fc7f4391bff4b6.pdf?AWSAccessKeyId=AKIAQEWIQRZNUU7RED6M&Signature=817PNpzIQo%2BupjT%2F1Sp9EKQD%2BYE%3D&Expires=1648466337",
"created_at": "2021-04-10"
},
"document_type": "supply_chain",
"created_at": "2022-03-25T07:47:01.801504Z",
"updated_at": "2022-03-25T07:47:01.801571Z"
}
],
"main_goals": {
"id": 4,
"workplan": {
"id": 1,
"strategic_partner": {
"id": 4,
"name": "Walmart",
"image": "/static/media/logo/logo_walmart.jpg"
},
"suggested_date": "2022-01-01",
"created_at": "2022-03-25T05:37:18.878541Z"
},
"ethical_recruitment": "ethical recruitment",
"partnership_areas": "partnership areas",
"worker_voice_escalation": "worker voice escalation",
"created_at": "2022-03-28T10:40:17.947229Z",
"updated_at": "2022-03-28T10:40:17.947289Z"
},
"progress_indicator": [
{
"id": 1,
"workplan": {
"id": 1,
"strategic_partner": {
"id": 4,
"name": "Walmart",
"image": "/static/media/logo/logo_walmart.jpg"
},
"suggested_date": "2022-01-01",
"created_at": "2022-03-25T05:37:18.878541Z"
},
"area": "worker_voice",
"sub_area": "percentage",
"numeric_value": 10,
"str_value": null,
"txt_value": null,
"created_at": "2022-03-28T10:55:17.016676Z",
"updated_at": "2022-03-28T10:55:17.016842Z"
}
],
"key_activities": [
{
"id": 1,
"workplan": {
"id": 1,
"strategic_partner": {
"id": 4,
"name": "Walmart",
"image": "/static/media/logo/logo_walmart.jpg"
},
"suggested_date": "2022-01-01",
"created_at": "2022-03-25T05:37:18.878541Z"
},
"area": "worker_voice",
"sub_area": "percentage",
"str_value": null,
"txt_value": null,
"created_at": "2022-03-28T11:02:00.497173Z",
"updated_at": "2022-03-28T11:02:00.497237Z"
}
],
"fp_name": "Some Name",
"fp_title": "mr",
"current_step": "workplan_activities",
"status": "saved",
"created_at": "2022-03-25T05:37:18.878541Z",
"updated_at": "2022-03-28T11:02:00.531896Z",
"pdf_file": null
}
```
### Get Workplan List
- api url: `{{host}}/api/v2/sp-workplan-activity/`
- headers:
```json=
{
"Authorization": "Bearer {{ACCESS_TOKEN}}"
}
```
- sample query params:
```json=
{
"strategic_partner__name": "wal",
"strategic_partner__id": 4,
"current_step": "introduction",
"status": "saved",
"created_at__gte": "2022-03-24", // also created_at__lte
"suggested_date__gte": "2021-01-20" // also suggested_date__gte
}
```
- sample response:
```json=
{
"count": 3,
"next": null,
"previous": null,
"results": [
{
"id": 4,
"strategic_partner": {
"id": 4,
"name": "Walmart",
"image": "/static/media/logo/logo_walmart.jpg"
},
"suggested_date": "2022-01-01",
"fp_name": "Some Name",
"fp_title": "mr",
"current_step": "introduction",
"status": "saved",
"created_at": "2022-03-28T09:50:10.480408Z",
"updated_at": "2022-03-28T09:50:10.480447Z",
"pdf_file": null
},
{
"id": 3,
"strategic_partner": {
"id": 4,
"name": "Walmart",
"image": "/static/media/logo/logo_walmart.jpg"
},
"suggested_date": "2022-01-01",
"fp_name": "Some Name",
"fp_title": "mr",
"current_step": "introduction",
"status": "saved",
"created_at": "2022-03-25T05:54:03.921713Z",
"updated_at": "2022-03-25T05:54:03.921762Z",
"pdf_file": null
},
{
"id": 2,
"strategic_partner": {
"id": 4,
"name": "Walmart",
"image": "/static/media/logo/logo_walmart.jpg"
},
"suggested_date": "2022-01-01",
"fp_name": "Some Name",
"fp_title": "mr",
"current_step": "introduction",
"status": "saved",
"created_at": "2022-03-25T05:52:54.621148Z",
"updated_at": "2022-03-25T05:52:54.621186Z",
"pdf_file": null
}
]
}
```