/partners/{id}Delete business partner logically with all necessary checks at first (pricelists, billings, balances, connections, coOwner, engagement).
Privileges:
- biz-core.manage
Audit event:
- biz.core.v2.partner.delete
Errors:
- BIZ_CORE:PARTNER_NOTFOUND - Partner with given id not found.
Request
Path parameters
id.
Request example
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Delete, "https://api-cpaas.sms.es/biz-core/v2/partners/{id}");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <access_token>");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());var options = new RestClientOptions("")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("https://api-cpaas.sms.es/biz-core/v2/partners/{id}", Method.Delete);
request.AddHeader("Accept", "application/json");
request.AddHeader("Authorization", "Bearer <access_token>");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);curl -L -X DELETE "https://api-cpaas.sms.es/biz-core/v2/partners/{id}" \
-H "Accept: application/json" \
-H "Authorization: Bearer <access_token>"var headers = {
'Accept': 'application/json',
'Authorization': 'Bearer <access_token>'
};
var dio = Dio();
var response = await dio.request(
'https://api-cpaas.sms.es/biz-core/v2/partners/{id}',
options: Options(
method: 'DELETE',
headers: headers,
),
);
if (response.statusCode == 200) {
print(json.encode(response.data));
}
else {
print(response.statusMessage);
}var headers = {
'Accept': 'application/json',
'Authorization': 'Bearer <access_token>'
};
var request = http.Request('DELETE', Uri.parse('https://api-cpaas.sms.es/biz-core/v2/partners/{id}'));
request.headers.addAll(headers);
http.StreamedResponse response = await request.send();
if (response.statusCode == 200) {
print(await response.stream.bytesToString());
}
else {
print(response.reasonPhrase);
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-cpaas.sms.es/biz-core/v2/partners/{id}"
method := "DELETE"
client := &http.Client{}
req, err := http.NewRequest(method, url, nil)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Accept", "application/json")
req.Header.Add("Authorization", "Bearer <access_token>")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}DELETE /biz-core/v2/partners/{id} HTTP/1.1
Host: api-cpaas.sms.es
Accept: application/json
Authorization: Bearer <access_token>OkHttpClient client = new OkHttpClient().newBuilder()
.build();
Request request = new Request.Builder()
.url("https://api-cpaas.sms.es/biz-core/v2/partners/{id}")
.method("DELETE", null)
.addHeader("Accept", "application/json")
.addHeader("Authorization", "Bearer <access_token>")
.build();
Response response = client.newCall(request).execute();Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.delete("https://api-cpaas.sms.es/biz-core/v2/partners/{id}")
.header("Accept", "application/json")
.header("Authorization", "Bearer <access_token>")
.asString();const myHeaders = new Headers();
myHeaders.append("Accept", "application/json");
myHeaders.append("Authorization", "Bearer <access_token>");
const requestOptions = {
method: "DELETE",
headers: myHeaders,
redirect: "follow"
};
fetch("https://api-cpaas.sms.es/biz-core/v2/partners/{id}", requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.error(error));var settings = {
"url": "https://api-cpaas.sms.es/biz-core/v2/partners/{id}",
"method": "DELETE",
"timeout": 0,
"headers": {
"Accept": "application/json",
"Authorization": "Bearer <access_token>"
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("DELETE", "https://api-cpaas.sms.es/biz-core/v2/partners/{id}");
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("Authorization", "Bearer <access_token>");
xhr.send();val client = OkHttpClient()
val request = Request.Builder()
.url("https://api-cpaas.sms.es/biz-core/v2/partners/{id}")
.delete()
.addHeader("Accept", "application/json")
.addHeader("Authorization", "Bearer <access_token>")
.build()
val response = client.newCall(request).execute()#include <stdio.h>
#include <curl/curl.h>
int main(void) {
CURL *curl = curl_easy_init();
if (curl) {
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(curl, CURLOPT_URL, "https://api-cpaas.sms.es/biz-core/v2/partners/{id}");
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Accept: application/json");
headers = curl_slist_append(headers, "Authorization: Bearer <access_token>");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
CURLcode res = curl_easy_perform(curl);
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
}
return 0;
}const axios = require('axios');
let config = {
method: 'delete',
maxBodyLength: Infinity,
url: 'https://api-cpaas.sms.es/biz-core/v2/partners/{id}',
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer <access_token>'
}
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});const https = require('follow-redirects').https;
const fs = require('fs');
let options = {
'method': 'DELETE',
'hostname': 'api-cpaas.sms.es',
'path': '/biz-core/v2/partners/{id}',
'headers': {
'Accept': 'application/json',
'Authorization': 'Bearer <access_token>'
},
'maxRedirects': 20
};
const req = https.request(options, function (res) {
let chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
let body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
req.end();#import <Foundation/Foundation.h>
dispatch_semaphore_t sema = dispatch_semaphore_create(0);
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://api-cpaas.sms.es/biz-core/v2/partners/{id}"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
NSDictionary *headers = @{
@"Accept": @"application/json",
@"Authorization": @"Bearer <access_token>"
};
[request setAllHTTPHeaderFields:headers];
[request setHTTPMethod:@"DELETE"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
dispatch_semaphore_signal(sema);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSError *parseError = nil;
NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
NSLog(@"%@",responseDictionary);
dispatch_semaphore_signal(sema);
}
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);open Lwt
open Cohttp
open Cohttp_lwt_unix
let reqBody =
let uri = Uri.of_string "https://api-cpaas.sms.es/biz-core/v2/partners/{id}" in
let headers = Header.init ()
|> fun h -> Header.add h "Accept" "application/json"
|> fun h -> Header.add h "Authorization" "Bearer <access_token>"
in
Client.call ~headers `DELETE uri >>= fun (_resp, body) ->
body |> Cohttp_lwt.Body.to_string >|= fun body -> body
let () =
let respBody = Lwt_main.run reqBody in
print_endline (respBody)<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api-cpaas.sms.es/biz-core/v2/partners/{id}',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => array(
'Accept: application/json',
'Authorization: Bearer <access_token>'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
<?php
$client = new Client();
$headers = [
'Accept' => 'application/json',
'Authorization' => 'Bearer <access_token>'
];
$request = new Request('DELETE', 'https://api-cpaas.sms.es/biz-core/v2/partners/{id}', $headers);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Accept", "application/json")
$headers.Add("Authorization", "Bearer <access_token>")
$response = Invoke-RestMethod "https://api-cpaas.sms.es/biz-core/v2/partners/{id}" -Method 'DELETE' -Headers $headers
$response | ConvertTo-Jsonimport requests
import json
url = "https://api-cpaas.sms.es/biz-core/v2/partners/{id}"
payload = {}
headers = {
"Accept": "application/json",
"Authorization": "Bearer <access_token>"
}
response = requests.request("DELETE", url, headers=headers, data=payload)
print(response.text)import http.client
import json
conn = http.client.HTTPSConnection("api-cpaas.sms.es")
payload = ''
headers = {
"Accept": "application/json",
"Authorization": "Bearer <access_token>"
}
conn.request("DELETE", "/biz-core/v2/partners/{id}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))library(httr)
headers = c(
'Accept' = 'application/json',
'Authorization' = 'Bearer <access_token>'
)
res <- VERB("DELETE", url = "https://api-cpaas.sms.es/biz-core/v2/partners/{id}", add_headers(headers))
cat(content(res, 'text'))require "uri"
require "json"
require "net/http"
url = URI("https://api-cpaas.sms.es/biz-core/v2/partners/{id}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Accept"] = "application/json"
request["Authorization"] = "Bearer <access_token>"
response = https.request(request)
puts response.read_body
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = reqwest::Client::builder()
.build()?;
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("Accept", "application/json".parse()?);
headers.insert("Authorization", "Bearer <access_token>".parse()?);
let request = client.request(reqwest::Method::from_bytes(b"DELETE")?, "https://api-cpaas.sms.es/biz-core/v2/partners/{id}")
.headers(headers);
let response = request.send().await?;
let body = response.text().await?;
println!("{}", body);
Ok(())
}http --follow --timeout 3600 DELETE "https://api-cpaas.sms.es/biz-core/v2/partners/{id}" \
'Accept':'application/json' \
'Authorization':'Bearer <access_token>'wget --no-check-certificate --quiet \
--method DELETE \
--timeout=0 \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <access_token>' \
'https://api-cpaas.sms.es/biz-core/v2/partners/{id}'var request = URLRequest(url: URL(string: "https://api-cpaas.sms.es/biz-core/v2/partners/{id}")!,timeoutInterval: Double.infinity)
request.addValue("application/json", forHTTPHeaderField: "Accept")
request.addValue("Bearer <access_token>", forHTTPHeaderField: "Authorization")
request.httpMethod = "DELETE"
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
print(String(describing: error))
return
}
print(String(data: data, encoding: .utf8)!)
}
task.resume()Responses
- 204
- 409
- default
Partner deleted successfully.
biz partner (bizPartnerId = xxxx) can have pricelists as customer and supplier for products SMS and MNP API endpoint for customerSMSPricelists: /bulk/pricelists/sms/selling?eq(customerId)=xxxx&all=yes API endpoint for supplierSMSPricelists: /bulk/pricelists/sms/buying?eq(supplierId)=xxxx&all=yes API endpoint for customerMNPPricelists: /bulk/pricelists/mnp/selling?eq(customerId)=xxxx&all=yes API endpoint for supplierMNPPricelists: /bulk/pricelists/mnp/buying?eq(supplierId)=xxxx&all=yes for activate/deactivate biz partner additional parameter must be sent on URI (&neq(status)=inactive) biz partner (bizPartnerId = xxxx) can have total balances as customer and supplier for products SMS and MNP API endpoint for customerSMSTotalBalances: /bulk/billing/v2/total-balances?eq(bizPartnerId)=xxxx&all=yes API endpoint for supplierSMSTotalBalances: /bulk/gate-billing/v2/total-balances?eq(bizPartnerId)=xxxx&all=yes API endpoint for customerMNPTotalBalances: /bulk/mnp-billing/v2/total-balances?eq(bizPartnerId)=xxxx&all=yes API endpoint for supplierMNPTotalBalances: /bulk/mnp-gate-billing/v2/total-balances?eq(bizPartnerId)=xxxx&all=yes for activate/deactivate biz partner additional parameter must be sent on URI (&neq(status)=inactive) biz partner (bizPartnerId = xxxx) can have billing accounts as customer and supplier for products SMS and MNP API endpoint for customerSMSBillingAccounts: /bulk/billing/v2/accounts?eq(bizPartnerId)=xxxx&all=yes API endpoint for supplierSMSBillingAccounts: /bulk/gate-billing/v2/accounts?eq(bizPartnerId)=xxxx&all=yes API endpoint for customerMNPBillingAccounts: /bulk/mnp-billing/v2/accounts?eq(bizPartnerId)=xxxx&all=yes API endpoint for supplierMNPBillingAccounts: /bulk/mnp-gate-billing/v2/accounts?eq(bizPartnerId)=xxxx&all=yes for activate/deactivate biz partner additional parameter must be sent on URI (&neq(status)=inactive) biz partner (bizPartnerId = xxxx) can have connections as customer and supplier for products SMS and MNP API endpoint for customerSMSConnections: /bulk/sms-accounts/v1/accounts?eq(customerId)=xxxx&all=yes API endpoint for supplierSMSConnections: /bulk/gates/v1/out-gates?eq(supplierId)=xxxx&all=yes API endpoint for customerMNPConnections: /bulk/mnp-accounts/v1/out-gates?eq(customerId)=xxxx&all=yes API endpoint for supplierMNPConnections: /bulk/mnp-supplier-accounts/v1/supplier-accounts?eq(supplierId)=xxxx&all=yes for activate/deactivate biz partner additional parameter must be sent on URI (&neq(status)=inactive) biz partner (bizPartnerId = xxxx) can have coOwners API endpoint for bizPartnerCoOwner: /biz-core/v2/partners?ownerBpId=xxxx biz partner (bizPartnerId = xxxx) can have NGages linked API endpoint for bizPartnerNGages: /news/v1/services?partnerId=xxxx for activate/deactivate biz partner additional parameter must be sent on URI (&neq(status)=inactive) Unable to delete Partner due it's instance role or relations (could be with pricelists, billings, balances, connections, coOwner, nGage) ### Example of JSON response for status code 409 ``` json { "error": { "code": "INVALID-PARAMETERS", "message": "Invalid parameters", "items": [ { "name": "customerSMSConnections", "message": "customerSMSConnections", "description": "ID: 1547 Name: 3396_VOICES_EUR; ID: 1639 Name: 3396_VOICES; ID: 1686 Name: Test Account Eco;" }, { "name": "supplierSMSConnections", "message": "supplierSMSConnections", "description": "ID: 369 Name: ODTTELEKOM;" }, { "name": "supplierSMSPricelists", "message": "supplierSMSPricelists", "description": "ID: 1105 Name: AV Pack PL 1; ID: 1110 Name: AV Pack PL 1; ID: 1107 Name: AV Pack PL 1; " }, { "name": "customerSMSPricelists", "message": "customerSMSPricelists", "description": "ID: 469 Name: 1061_ECO; ID: 470 Name: 1061_FIXID; ID: 1038 Name: 1061_SUNRISE; ID: 1729 Name: TP-PL; " }, { "name": "customerSMSTotalBalances", "message": "customerSMSTotalBalances", "description": "ID: 37 Name: Cortex Postpaid CHF; ID: 38 Name: Cortex Postpaid EUR; ID: 135 Name: fdg; ID: 143 Name: Cortex Prepaid EUR; " }, { "name": "supplierSMSTotalBalances", "message": "supplierSMSTotalBalances", "description": "ID: 33\tName: Cortex Communications AG postpaid CHF\n" }, { "name": "customerSMSBillingAccount", "message": "customerSMSBillingAccount", "description": "ID: 41 Name: 3396_VOICES_EUR; ID: 42 Name: 3396_VOICES; ID: 43 Name: 1061_FIXID; " }, { "name": "users", "message": "users", "description": "UUID: 00e6b284-c66b-44a4-9858-98fd5e1be6ed First Name: John Last Name: Doe Email: john.doe@doe.com; " }, { "name": "appSubjects", "message": "appSubjects", "description": "App subject UUID: 00e6b284-c66b-44a4-9858-98fd5e1be6ed Description: App description ; " }, { "name": "groupSubjects", "message": "groupSubjects", "description": "Group subject UUID: 00e6b284-c66b-44a4-9858-98fd5e1be6ed Description: Group description ; " }, { "name": "unknownSubjects", "message": "unknownSubjects", "description": "Unknown subject UUID: 00e6b284-c66b-44a4-9858-98fd5e1be6ed Description: Unknown description ; " } ] } }
```
Show child attributes
50id of details for section DETAILS or id of contact for section CONTACTS
10{
"code": "string",
"items": [
{
"description": "string",
"name": "string",
"sectionRowId": 0,
"value": "string"
}
],
"message": "string"
}Unexpected error.
{
"Code": 0,
"Message": "string"
}