Create a product for an organization
POSThttp://localhost:8080/api/v1/organizations/:organizationId/products
Create a product for an organization
Request
Path Parameters
organizationId int64required
The organization's ID.
- application/json
Body
descriptionString (null,string)nullable
nameString (string)required
Responses
- 201
- 401
Success
Response Headers
- application/json
- Schema
- Example (auto)
- Create product
Schema
descriptionString (null,string)nullable
idint64required
nameString (string)required
organizationIdint64required
{
"id": 0,
"name": "string",
"organizationId": 0
}
{
"id": 1,
"organizationId": 2,
"name": "My product",
"description": "Description"
}
Invalid Token
Response Headers
Authorization: oauth2
name: tokentype: oauth2flows: {
"authorizationCode": {
"authorizationUrl": "http://localhost:8081/realms/master/protocol/openid-connect/auth",
"tokenUrl": "http://localhost:8081/realms/master/protocol/openid-connect/token",
"scopes": {}
}
}
- 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, "http://localhost:8080/api/v1/organizations/:organizationId/products");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <token>");
var content = new StringContent("{\n \"name\": \"string\"\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
ResponseClear