private static async Task InitializeWithConfiguration() { var client = new SmartShare(Configuration); var tokenResult = await client.GenerateTokenAsync(); var a = new ListaDocumentoRequest() { quantidade = 30, stApenasDocumentosAprovados = true, lstIndices = new System.Collections.Generic.List <Indice>() { new Indice(1, "=", "") } }; var documentos = await client.ListDocumentsAsync(a); }
public async Task <IList <ListaDocumentosResponse> > ListDocumentsAsync(ListaDocumentoRequest listaDocumentoRequest) { var authentication = await GenerateTokenAsync(); string path = "v2/Documento/ListaDocumentos"; var request = ConfigureRequest(path, Method.POST, authentication.TokenUsuario); request.AddJsonBody(listaDocumentoRequest); var response = await _client.ExecuteAsync(request); if (!response.IsSuccessful) { throw new SmartShareException("Error from SmartShare.", response.Content); } return(JsonConvert.DeserializeObject <IList <ListaDocumentosResponse> >(response.Content)); }