All URIs are relative to https://api.wfp.org/vam-data-bridges/1.3.1
Method | HTTP request | Description |
---|---|---|
CommoditiesCategoriesListGet | GET /Commodities/Categories/List | Provides the list of categories. |
CommoditiesListGet | GET /Commodities/List | Provide the detailed list of the commodities available in DataBridges platform |
PagedCommodityListDTO CommoditiesCategoriesListGet(country_code = var.country_code, category_name = var.category_name, category_id = 0, page = 1, format = "json", env = var.env)
Provides the list of categories.
Categories are matched with high level WFP commodity classification at level 1. No mandatory parameter. Data Controller - Wael Attia API Integration Pattern - This endpoint uses Hey Jude pattern
library(DataBridgesAPIr)
# Provides the list of categories.
#
# prepare function argument(s)
var_country_code <- "country_code_example" # character | The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code (Optional)
var_category_name <- "category_name_example" # character | The name, even partial and case insensitive, of a commodity category. (Optional)
var_category_id <- 0 # integer | The exact ID of a Commodity, as found in /Commodities/List. (Optional)
var_page <- 1 # integer | page number for paged results (Optional)
var_format <- "json" # character | Output format: [JSON|CSV] Json is the default value (Optional)
var_env <- "env_example" # character | Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org (Optional)
api_instance <- CommoditiesApi$new()
# Configure OAuth2 access token for authorization: default
api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
# result <- api_instance$CommoditiesCategoriesListGet(country_code = var_country_code, category_name = var_category_name, category_id = var_category_id, page = var_page, format = var_format, env = var_envdata_file = "result.txt")
result <- api_instance$CommoditiesCategoriesListGet(country_code = var_country_code, category_name = var_category_name, category_id = var_category_id, page = var_page, format = var_format, env = var_env)
dput(result)
Name | Type | Description | Notes |
---|---|---|---|
country_code | character | The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code | [optional] |
category_name | character | The name, even partial and case insensitive, of a commodity category. | [optional] |
category_id | integer | The exact ID of a Commodity, as found in /Commodities/List. | [optional] [default to 0] |
page | integer | page number for paged results | [optional] [default to 1] |
format | character | Output format: [JSON | CSV] Json is the default value |
env | Enum [prod, dev] | Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org | [optional] |
- Content-Type: Not defined
- Accept: application/json, text/json, text/plain
Status code | Description | Response headers |
---|---|---|
200 | Success | - |
400 | Bad Request | - |
PagedCommodityListDTO CommoditiesListGet(country_code = var.country_code, commodity_name = var.commodity_name, commodity_id = 0, page = 1, format = "json", env = var.env)
Provide the detailed list of the commodities available in DataBridges platform
COICOP 2018 codes are returned to hierarchically matching categories based on UN-Statistical Division codes. No mandatory parameter. Data Controller - Wael Attia API Integration Pattern - This endpoint uses Hey Jude pattern
library(DataBridgesAPIr)
# Provide the detailed list of the commodities available in DataBridges platform
#
# prepare function argument(s)
var_country_code <- "country_code_example" # character | The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code (Optional)
var_commodity_name <- "commodity_name_example" # character | The name, even partial and case insensitive, of a commodity (Optional)
var_commodity_id <- 0 # integer | The exact ID of a commodity (Optional)
var_page <- 1 # integer | page number for paged results (Optional)
var_format <- "json" # character | Output format: [JSON|CSV] Json is the default value (Optional)
var_env <- "env_example" # character | Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org (Optional)
api_instance <- CommoditiesApi$new()
# Configure OAuth2 access token for authorization: default
api_instance$api_client$access_token <- Sys.getenv("ACCESS_TOKEN")
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
# result <- api_instance$CommoditiesListGet(country_code = var_country_code, commodity_name = var_commodity_name, commodity_id = var_commodity_id, page = var_page, format = var_format, env = var_envdata_file = "result.txt")
result <- api_instance$CommoditiesListGet(country_code = var_country_code, commodity_name = var_commodity_name, commodity_id = var_commodity_id, page = var_page, format = var_format, env = var_env)
dput(result)
Name | Type | Description | Notes |
---|---|---|---|
country_code | character | The code to identify the country. It can be a ISO-3166 Alpha 3 code or the VAM internal admin0code | [optional] |
commodity_name | character | The name, even partial and case insensitive, of a commodity | [optional] |
commodity_id | integer | The exact ID of a commodity | [optional] [default to 0] |
page | integer | page number for paged results | [optional] [default to 1] |
format | character | Output format: [JSON | CSV] Json is the default value |
env | Enum [prod, dev] | Environment. * `prod` - api.vam.wfp.org * `dev` - dev.api.vam.wfp.org | [optional] |
- Content-Type: Not defined
- Accept: application/json, text/json, text/plain
Status code | Description | Response headers |
---|---|---|
200 | Success | - |
400 | Bad Request | - |