共用方式為


DeleteAccount Service 作業 - 客戶管理

刪除帳戶。

注意事項

只有具有超級 管理員 認證的使用者可以刪除帳戶。 如需詳細資訊,請參閱 使用者角色 技術指南。

因為刪除作業需要最近帳戶寫入作業的時間戳,所以您必須先呼叫 GetAccount 作業。 GetAccount 作業會傳回帳戶的數據,其中包含時間戳。 如果您使用舊的時間戳,例如,在取得時間戳之後,您的應用程式或其他應用程式會更新帳戶數據,則刪除呼叫將會失敗。

刪除帳戶之後,即可在 Microsoft Advertising Web 應用程式中搜尋並顯示為非作用中。 您不一定選擇在應用程式中呈現非作用中的帳戶。

要求專案

DeleteAccountRequest 物件會定義服務作業要求的主體標頭元素。 元素的順序必須與 要求SOAP中所示的順序相同。

注意事項

除非下面另有說明,否則所有要求專案都是必要的。

要求本文專案

元素 描述 資料類型
AccountId 要刪除之帳戶的標識碼。
時間戳 作業用來協調更新的時間戳值。 您必須呼叫 GetAccount 以取得時間戳值。 如果帳戶物件的時間戳值與您傳遞的時間戳值不同,刪除作業就會失敗。 base64Binary

要求標頭元素

元素 描述 資料類型
AuthenticationToken OAuth 存取令牌,代表有權Microsoft Advertising 帳戶之用戶的認證。

如需詳細資訊,請 參閱使用 OAuth 進行驗證
string
DeveloperToken 用來存取 Bing 廣告 API 的開發人員令牌。

如需詳細資訊 ,請參閱取得開發人員令牌
string
密碼 此元素會保留供內部使用,並會從未來的 API 版本中移除。 您必須使用 AuthenticationToken 元素來設定用戶認證。 string
UserName 此元素會保留供內部使用,並會從未來的 API 版本中移除。 您必須使用 AuthenticationToken 元素來設定用戶認證。 string

Response 元素

DeleteAccountResponse 物件會定義服務作業響應的主體標頭元素。 這些元素的傳回順序與 回應SOAP中所示的順序相同。

回應本文專案

作業的響應主體中沒有任何專案。

回應標頭元素

元素 描述 資料類型
TrackingId 包含 API 呼叫詳細數據的記錄項目識別碼。 string

要求SOAP

此範本是由工具所產生,用來顯示SOAP要求的主體標頭元素順序。 如需可搭配此服務作業使用的支援類型,請參閱上述 的要求本文項目 參考。

<s:Envelope xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Header xmlns="https://bingads.microsoft.com/Customer/v13">
    <Action mustUnderstand="1">DeleteAccount</Action>
    <AuthenticationToken i:nil="false">ValueHere</AuthenticationToken>
    <DeveloperToken i:nil="false">ValueHere</DeveloperToken>
  </s:Header>
  <s:Body>
    <DeleteAccountRequest xmlns="https://bingads.microsoft.com/Customer/v13">
      <AccountId>ValueHere</AccountId>
      <TimeStamp i:nil="false">ValueHere</TimeStamp>
    </DeleteAccountRequest>
  </s:Body>
</s:Envelope>

回應 SOAP

此範本是由工具所產生,用來顯示SOAP回應的 主體標頭 元素順序。

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Header xmlns="https://bingads.microsoft.com/Customer/v13">
    <TrackingId d3p1:nil="false" xmlns:d3p1="http://www.w3.org/2001/XMLSchema-instance">ValueHere</TrackingId>
  </s:Header>
  <s:Body>
    <DeleteAccountResponse xmlns="https://bingads.microsoft.com/Customer/v13" />
  </s:Body>
</s:Envelope>

程序代碼語法

範例語法可以與 Bing 廣告 SDK 搭配使用。 如需更多範例,請參閱 Bing 廣告 API 程式代碼範 例。

public async Task<DeleteAccountResponse> DeleteAccountAsync(
	long accountId,
	base64Binary timeStamp)
{
	var request = new DeleteAccountRequest
	{
		AccountId = accountId,
		TimeStamp = timeStamp
	};

	return (await CustomerManagementService.CallAsync((s, r) => s.DeleteAccountAsync(r), request));
}
static DeleteAccountResponse deleteAccount(
	java.lang.Long accountId,
	byte[] timeStamp) throws RemoteException, Exception
{
	DeleteAccountRequest request = new DeleteAccountRequest();

	request.setAccountId(accountId);
	request.setTimeStamp(timeStamp);

	return CustomerManagementService.getService().deleteAccount(request);
}
static function DeleteAccount(
	$accountId,
	$timeStamp)
{

	$GLOBALS['Proxy'] = $GLOBALS['CustomerManagementProxy'];

	$request = new DeleteAccountRequest();

	$request->AccountId = $accountId;
	$request->TimeStamp = $timeStamp;

	return $GLOBALS['CustomerManagementProxy']->GetService()->DeleteAccount($request);
}
response=customermanagement_service.DeleteAccount(
	AccountId=AccountId,
	TimeStamp=TimeStamp)

需求

服務: CustomerManagementService.svc v13
命名空間: https://bingads.microsoft.com/Customer/v13

要求 URL

https://clientcenter.api.bingads.microsoft.com/CustomerManagement/v13/Account

要求專案

DeleteAccountRequest 物件會定義服務作業要求的主體標頭元素。

注意事項

除非下面另有說明,否則所有要求專案都是必要的。

要求本文專案

元素 描述 資料類型
AccountId 要刪除之帳戶的標識碼。
時間戳 作業用來協調更新的時間戳值。 您必須呼叫 GetAccount 以取得時間戳值。 如果帳戶物件的時間戳值與您傳遞的時間戳值不同,刪除作業就會失敗。 base64Binary

要求標頭元素

元素 描述 資料類型
授權 OAuth 存取令牌,代表有權Microsoft Advertising 帳戶之用戶的認證。 請確定令牌前面加上 「Bearer」 ,這是正確驗證的必要專案。

如需詳細資訊,請 參閱使用 OAuth 進行驗證
string
DeveloperToken 用來存取 Bing 廣告 API 的開發人員令牌。

如需詳細資訊 ,請參閱取得開發人員令牌
string
密碼 此元素會保留供內部使用,並會從未來的 API 版本中移除。 您必須使用 AuthenticationToken 元素來設定用戶認證。 string
UserName 此元素會保留供內部使用,並會從未來的 API 版本中移除。 您必須使用 AuthenticationToken 元素來設定用戶認證。 string

Response 元素

DeleteAccountResponse 物件會定義服務作業響應的主體標頭元素。 這些元素的傳回順序與 回應 JSON 中所示的順序相同。

回應本文專案

作業的響應主體中沒有任何專案。

回應標頭元素

元素 描述 資料類型
TrackingId 包含 API 呼叫詳細數據的記錄項目識別碼。 string

要求 JSON

此範本是由工具所產生,用來顯示 JSON 要求的 主體標頭 元素。 如需可搭配此服務作業使用的支援類型,請參閱上述 的要求本文項目 參考。

{
  "AccountId": "LongValueHere",
  "TimeStamp": "ValueHere"
}

回應 JSON

此範本是由工具所產生,用來顯示 JSON 回應的 主體標頭 元素。

{}

程序代碼語法

若要透過 SDK 呼叫 REST API,您必須將 SDK 升級至特定版本並設定系統參數。範例語法可以與 Bing 廣告 SDK 搭配使用。 如需更多範例,請參閱 Bing 廣告 API 程式代碼範 例。

public async Task<DeleteAccountResponse> DeleteAccountAsync(
	long accountId,
	base64Binary timeStamp)
{
	var request = new DeleteAccountRequest
	{
		AccountId = accountId,
		TimeStamp = timeStamp
	};

	return (await CustomerManagementService.CallAsync((s, r) => s.DeleteAccountAsync(r), request));
}
static DeleteAccountResponse deleteAccount(
	java.lang.Long accountId,
	byte[] timeStamp) throws RemoteException, Exception
{
	DeleteAccountRequest request = new DeleteAccountRequest();

	request.setAccountId(accountId);
	request.setTimeStamp(timeStamp);

	return CustomerManagementService.getService().deleteAccount(request);
}
static function DeleteAccount(
	$accountId,
	$timeStamp)
{

	$GLOBALS['Proxy'] = $GLOBALS['CustomerManagementProxy'];

	$request = new DeleteAccountRequest();

	$request->AccountId = $accountId;
	$request->TimeStamp = $timeStamp;

	return $GLOBALS['CustomerManagementProxy']->GetService()->DeleteAccount($request);
}
response=customermanagement_service.DeleteAccount(
	AccountId=AccountId,
	TimeStamp=TimeStamp)