Create A Custom API Role Policy
POSThttps://useast.api.elasticpath.com/v2/permissions/custom-api-role-policies
Create A Custom API Role Policy
Request
Responses
- 201
- 400
- 409
- 500
Created
Bad request. The request failed validation.
Unable to perform the operation at this time.
Internal server error. There was a system failure in the platform.
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/permissions/custom-api-role-policies");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <token>");
var content = new StringContent("{\n \"data\": {\n \"type\": \"string\",\n \"create\": true,\n \"list\": true,\n \"read\": true,\n \"update\": true,\n \"delete\": true,\n \"relationships\": {\n \"custom_api\": {\n \"data\": {\n \"id\": \"652e39d8-d613-493e-8c20-fef99ad6327a\",\n \"type\": \"string\"\n }\n },\n \"role\": {\n \"data\": {\n \"id\": \"f5f77dd6-71df-48a4-b4f4-d2605a79f3ca\",\n \"type\": \"string\"\n }\n }\n }\n }\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
ResponseClear