Create an Application Key
POSThttps://useast.api.elasticpath.com/v2/application-keys
Create an Application Key
Request
- application/json
Bodyrequired
data ApplicationKeyrequired
Responses
- 201
- 400
- 409
- default
Created
- application/json
- Schema
- Example (auto)
Schema
data object
{
"data": {
"id": "0c45e4ec-26e0-4043-86e4-c15b9cf985a0",
"name": "App Key",
"type": "string",
"client_id": "Z2dDp1f1Tg30p2C6ZVit7W1AKUtVhMVSTAPOIK4adA",
"client_secret": "jN8qLHneOn8C1rv0r3J3XZK1cRiZG3rajcLi9X1cZZ",
"reserved_rate_limit": 10,
"meta": {
"timestamps": {
"created_at": "2017-01-10T11:41:19.244Z",
"updated_at": "2017-01-10T11:41:19.244Z",
"last_used_at": "2017-01-10T11:41:19.244Z"
}
},
"links": {
"self": "https://useast.api.elasticpath.com/v2/application-keys/0c45e4ec-26e0-4043-86e4-c15b9cf985a0"
}
}
}
Bad request. The request failed validation.
- application/json
- Schema
- Example (auto)
- missing-name
Schema
errors Error[]required
{
"errors": [
{
"title": "string",
"status": "string",
"detail": "string"
}
]
}
Required field missing
{
"errors": [
{
"title": "Bad Request",
"status": "400",
"detail": "The field 'name' is required."
}
]
}
Conflict
- application/json
- Schema
- Example (auto)
- exceeds-limit
Schema
errors Error[]required
{
"errors": [
{
"title": "string",
"status": "string",
"detail": "string"
}
]
}
Requested limit exceeds maximum
{
"errors": [
{
"detail": "requested reserved rate limit will exceed the maximum",
"status": "409",
"title": "Conflict"
}
]
}
Internal server error. There was a system failure in the platform.
- application/json
- Schema
- Example (auto)
- internal-server-error
Schema
errors Error[]required
{
"errors": [
{
"title": "string",
"status": "string",
"detail": "string"
}
]
}
Internal server error
{
"errors": [
{
"title": "Internal Server Error",
"status": "500",
"detail": "there was a problem processing your request"
}
]
}
Authorization: http
name: bearerAuthtype: httpscheme: bearer
- csharp
- curl
- dart
- go
- http
- java
- javascript
- kotlin
- c
- nodejs
- objective-c
- ocaml
- php
- powershell
- python
- r
- ruby
- rust
- shell
- swift
- HTTPCLIENT
- RESTSHARP
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://useast.api.elasticpath.com/v2/application-keys");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <token>");
var content = new StringContent("{\n \"data\": {\n \"name\": \"App Key\",\n \"reserved_rate_limit\": 10,\n \"type\": \"string\"\n }\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
ResponseClear