Bulk add / update network compressor(s)
POST
https://data.onxecta.com/api/production/network/compressor
Body Parameters
- bodyNetworkCompressorInput[]required
- sourceNetworkIdstringrequiredDescriptionMax Length100
- sourceIdstringrequiredDescriptionMax Length100
- datestring<date-time>requiredDescriptionFormatdate-time
- typeNetworkCompressorTyperequiredDescriptionDefaultSCREW
- upstreamSourceIdstringrequiredDescriptionMax Length255
- downstreamSourceIdstringrequiredDescriptionMax Length255
- enabledbooleanrequiredDescription
Responses
200
- NetworkCompressor[]
- xidstring<uuid>requiredFormatuuid
- sourceNetworkIdstringrequiredDescription
- sourceIdstringrequiredDescription
- datestring<date-time>requiredDescriptionFormatdate-time
- typeNetworkCompressorTypeDescriptionDefaultSCREW
- upstreamSourceIdstringrequiredDescription
- downstreamSourceIdstringrequiredDescription
- enabledbooleanrequiredDescription
curl
curl --request POST \
--url https://data.onxecta.com/api/production/network/compressor \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '[
{
"sourceNetworkId": "",
"sourceId": "",
"date": "",
"type": "SCREW",
"upstreamSourceId": "",
"downstreamSourceId": "",
"enabled": ""
}
]'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var raw = JSON.stringify([
{
"sourceNetworkId": "",
"sourceId": "",
"date": "",
"type": "SCREW",
"upstreamSourceId": "",
"downstreamSourceId": "",
"enabled": ""
}
]);
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://data.onxecta.com/api/production/network/compressor", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));python
import requests
import json
url = "https://data.onxecta.com/api/production/network/compressor"
payload = json.dumps([
{
"sourceNetworkId": "",
"sourceId": "",
"date": "",
"type": "SCREW",
"upstreamSourceId": "",
"downstreamSourceId": "",
"enabled": ""
}
])
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
csharp
var options = new RestClientOptions("https://data.onxecta.com")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/production/network/compressor", Method.Post);
request.AddHeader("accept", "application/json");
request.AddHeader("content-type", "application/json");
var body = @"[" + "\n" +
@" {" + "\n" +
@" ""sourceNetworkId"": """"," + "\n" +
@" ""sourceId"": """"," + "\n" +
@" ""date"": """"," + "\n" +
@" ""type"": ""SCREW""," + "\n" +
@" ""upstreamSourceId"": """"," + "\n" +
@" ""downstreamSourceId"": """"," + "\n" +
@" ""enabled"": """"" + "\n" +
@" }" + "\n" +
@"]";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "[\n {\n \"sourceNetworkId\": \"\",\n \"sourceId\": \"\",\n \"date\": \"\",\n \"type\": \"SCREW\",\n \"upstreamSourceId\": \"\",\n \"downstreamSourceId\": \"\",\n \"enabled\": \"\"\n }\n]");
Request request = new Request.Builder()
.url("https://data.onxecta.com/api/production/network/compressor")
.method("POST", body)
.addHeader("accept", "application/json")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();200
// OK
[
{
"xid": "",
"sourceNetworkId": "",
"sourceId": "",
"date": "",
"type": "",
"upstreamSourceId": "",
"downstreamSourceId": "",
"enabled": false
}
]