Obtém um URL para transferir vários documentos de fatura (pdf da fatura, recibos fiscais, notas de crédito) como um ficheiro zip.
POST https://management.azure.com/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/downloadDocuments?api-version=2020-05-01
Parâmetros do URI
Name |
Em |
Necessário |
Tipo |
Description |
subscriptionId
|
path |
True
|
string
|
O ID que identifica exclusivamente uma subscrição do Azure.
|
api-version
|
query |
True
|
string
|
A versão da API a ser utilizada com o pedido de cliente. A versão atual é 2020-05-01.
|
Corpo do Pedido
Name |
Tipo |
Description |
downloadUrls
|
string[]
|
Uma matriz de URLs de transferência para documentos individuais
|
Respostas
Name |
Tipo |
Description |
200 OK
|
DownloadUrl
|
OK. O pedido foi efetuada com êxito.
|
202 Accepted
|
|
Aceite.
Headers
- Location: string
- Retry-After: string
|
Other Status Codes
|
ErrorResponse
|
Resposta de erro que descreve o motivo pela qual a operação falhou.
|
Segurança
azure_auth
Fluxo OAuth2 do Azure Active Directory.
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name |
Description |
user_impersonation
|
representar a sua conta de utilizador
|
Exemplos
BillingSubscriptionInvoiceDownload
Sample Request
POST https://management.azure.com/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/downloadDocuments?api-version=2020-05-01
[
"https://management.azure.com/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01",
"https://management.azure.com/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01",
"https://management.azure.com/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01"
]
import java.util.Arrays;
/** Samples for Invoices DownloadMultipleBillingSubscriptionInvoices. */
public final class Main {
/*
* x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/MultipleBillingSubscriptionInvoiceDownload.json
*/
/**
* Sample code: BillingSubscriptionInvoiceDownload.
*
* @param manager Entry point to BillingManager.
*/
public static void billingSubscriptionInvoiceDownload(com.azure.resourcemanager.billing.BillingManager manager) {
manager
.invoices()
.downloadMultipleBillingSubscriptionInvoices(
Arrays
.asList(
"https://management.azure.com/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01",
"https://management.azure.com/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01",
"https://management.azure.com/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01"),
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armbilling_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/billing/armbilling"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/MultipleBillingSubscriptionInvoiceDownload.json
func ExampleInvoicesClient_BeginDownloadMultipleBillingSubscriptionInvoices() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbilling.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewInvoicesClient().BeginDownloadMultipleBillingSubscriptionInvoices(ctx, []*string{
to.Ptr("https://management.azure.com/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01"),
to.Ptr("https://management.azure.com/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01"),
to.Ptr("https://management.azure.com/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01")}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.DownloadURL = armbilling.DownloadURL{
// URL: to.Ptr("https://myaccount.blob.core.windows.net/invoices/1383724.pdf?sv=2019-02-02&sr=b&sp=r"),
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { BillingManagementClient } = require("@azure/arm-billing");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file.
*
* @summary Gets a URL to download multiple invoice documents (invoice pdf, tax receipts, credit notes) as a zip file.
* x-ms-original-file: specification/billing/resource-manager/Microsoft.Billing/stable/2020-05-01/examples/MultipleBillingSubscriptionInvoiceDownload.json
*/
async function billingSubscriptionInvoiceDownload() {
const subscriptionId = "{subscriptionId}";
const downloadUrls = [
"https://management.azure.com/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01",
"https://management.azure.com/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01",
"https://management.azure.com/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}/download?downloadToken={downloadToken}&useCache=True&api-version=2020-05-01",
];
const credential = new DefaultAzureCredential();
const client = new BillingManagementClient(credential, subscriptionId);
const result = await client.invoices.beginDownloadMultipleBillingSubscriptionInvoicesAndWait(
downloadUrls
);
console.log(result);
}
billingSubscriptionInvoiceDownload().catch(console.error);
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
Location: https://management.azure.com/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/operationResults/invoiceDownload_{operationId}?api-version=2020-05-01
Retry-After: 10
{
"url": "https://myaccount.blob.core.windows.net/invoices/1383724.pdf?sv=2019-02-02&sr=b&sp=r"
}
Definições
Name |
Description |
DownloadUrl
|
Um URL seguro que pode ser utilizado para transferir uma entidade até o URL expirar.
|
ErrorDetails
|
Os detalhes do erro.
|
ErrorResponse
|
A resposta de erro indica que o serviço não consegue processar o pedido recebido. O motivo é fornecido na mensagem de erro.
|
ErrorSubDetails
|
|
DownloadUrl
Um URL seguro que pode ser utilizado para transferir uma entidade até o URL expirar.
Name |
Tipo |
Description |
expiryTime
|
string
|
A hora em UTC em que o URL de transferência irá expirar.
|
url
|
string
|
O URL para o ficheiro PDF.
|
ErrorDetails
Os detalhes do erro.
Name |
Tipo |
Description |
code
|
string
|
Código de erro.
|
details
|
ErrorSubDetails[]
|
Os sub detalhes do erro.
|
message
|
string
|
Mensagem de erro a indicar o motivo pela qual a operação falhou.
|
target
|
string
|
O destino do erro específico.
|
ErrorResponse
A resposta de erro indica que o serviço não consegue processar o pedido recebido. O motivo é fornecido na mensagem de erro.
Name |
Tipo |
Description |
error
|
ErrorDetails
|
Os detalhes do erro.
|
ErrorSubDetails
Name |
Tipo |
Description |
code
|
string
|
Código de erro.
|
message
|
string
|
Mensagem de erro a indicar o motivo pela qual a operação falhou.
|
target
|
string
|
O destino do erro específico.
|