Hi @Olu
I’m having an error creating a key and I’m not sure why, if you can help me with this that would be awesome, don’t know what I’m missing.
This is the error I get when I’m trying to create a Key for the API:
{
"status": "error",
"message": "Failed to create key - attempting to apply policy from different organisation to key, skipping"
}
API configuration
{
"name": "customer001",
"api_id": "988167b8b88b42056033b3c3a69fd614",
"org_id": "customer001",
"id": "6136a5407fb58700010858fe",
"active": true,
"auth": {
"auth_header_name": "authorization",
"use_param": false,
"param_name": "",
"use_cookie": false,
"cookie_name": ""
},
"disable_quota": false,
"cache_options": {
"cache_timeout": 60,
"enable_cache": true,
"cache_all_safe_requests": false,
"cache_response_codes": [],
"enable_upstream_cache_control": false,
"cache_control_ttl_header": "",
"cache_by_headers": []
},
"enable_batch_request_support": true,
"definition": {
"location": "url",
"key": "v1",
"strip_path": false
},
"version_data": {
"not_versioned": false,
"default_version": "v1",
"versions": {
"v1": {
"name": "v1",
"expires": "",
"paths": {
"ignored": [],
"white_list": [],
"black_list": []
},
"use_extended_paths": true,
"extended_paths": {},
"global_headers": {},
"global_headers_remove": [],
"global_response_headers": {},
"global_response_headers_remove": [],
"ignore_endpoint_case": false,
"global_size_limit": 0,
"override_target": ""
}
}
},
"proxy": {
"preserve_host_header": true,
"listen_path": "/988167b8b88b42056033b3c3a69fd614/",
"target_url": "",
"disable_strip_slash": true,
"strip_listen_path": false,
"enable_load_balancing": true,
"target_list": [
"http://httpbin.org"
],
"check_host_against_uptime_tests": false,
"service_discovery": {
"use_discovery_service": false,
"query_endpoint": "",
"use_nested_query": false,
"parent_data_path": "",
"data_path": "",
"port_data_path": "",
"target_path": "",
"use_target_list": false,
"cache_timeout": 0,
"endpoint_returns_list": false
},
"transport": {
"ssl_insecure_skip_verify": false,
"ssl_ciphers": [],
"ssl_min_version": 0,
"ssl_max_version": 0,
"ssl_force_common_name_check": false,
"proxy_url": ""
}
},
"domain": "api.example.com",
"global_rate_limit": {
"rate": 10,
"per": 60
},
"protocol": "https",
"listen_port": 0,
"strip_auth_data": false
}
Policy configuration in /policies/policies.json
{
"free": {
"rate": 10,
"per": 60,
"quota_max": 15,
"quota_remaining": 15,
"quota_renewal_rate": 120,
"access_rights": {
"988167b8b88b42056033b3c3a69fd614": {
"apiname": "customer001",
"apiid": "988167b8b88b42056033b3c3a69fd614",
"versions": [
"v1"
],
"allowed_urls": []
}
},
"name": "Free plan",
"active": true,
"is_inactive": false,
"tags": [],
"key_expires_in": 0
}
}
Generate key JSON body
{
"is_inactive": false,
"access_rights": {
"988167b8b88b42056033b3c3a69fd614": {
"api_name": "customer001",
"api_id": "988167b8b88b42056033b3c3a69fd614",
"versions": [
"v1"
],
"allowed_urls": [],
"limit": null,
"allowance_scope": ""
}
},
"apply_policies": [
"free"
]
}