# Need help to download af PDF that is a stream of RAW bytes

**URL:** https://community.thunkable.com/t/need-help-to-download-af-pdf-that-is-a-stream-of-raw-bytes/1125447
**Category:** Questions about Thunkable X
**Created:** [February 25, 2021, 7:50pm UTC](https://community.thunkable.com/t/need-help-to-download-af-pdf-that-is-a-stream-of-raw-bytes/1125447 "2021-02-25T19:50:07Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![funhall](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/funhall/32/92145_2.png) [@funhall](https://community.thunkable.com/u/funhall)
#### Post date: [February 25, 2021, 7:50pm UTC](https://community.thunkable.com/t/need-help-to-download-af-pdf-that-is-a-stream-of-raw-bytes/1125447/1 "2021-02-25T19:50:07Z")

</div>

Hi All.

I am getting respons from my account API with invoices from my customers. And I need to download the invoices locally or other place. And they are telling me that when i try to get the file i will recieve it as a stream of RAW bytes I need to save as PDF.  
Can some one please explaine that in Thunkable language and how can I solve that please…

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [February 25, 2021, 11:14pm UTC](https://community.thunkable.com/t/need-help-to-download-af-pdf-that-is-a-stream-of-raw-bytes/1125447/2 "2021-02-25T23:14:30Z")

</div>

If the API is returning bytes, what does that data look like? I’m assuming it’s formatted in Base64. If that’s the case, you may need a decoder like [this](https://base64.guru/converter/decode/pdf).

Can you post a sample of that data (you’d want to strip out any personal info first…)?

---

<div class="post-metadata">

### Author: ![funhall](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/funhall/32/92145_2.png) [@funhall](https://community.thunkable.com/u/funhall)
#### Post date: [February 26, 2021, 3:58pm UTC](https://community.thunkable.com/t/need-help-to-download-af-pdf-that-is-a-stream-of-raw-bytes/1125447/3 "2021-02-26T15:58:35Z")

</div>

Hi now it have nothing with Base64 to do.  
It is a raw file. So the respons I have to save as PDF somehow. Can you help me with that please

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [February 26, 2021, 4:34pm UTC](https://community.thunkable.com/t/need-help-to-download-af-pdf-that-is-a-stream-of-raw-bytes/1125447/4 "2021-02-26T16:34:21Z")

</div>

I don’t know what a “raw file” means. Can you provide a sample? Without seeing the data, there’s no way I can help you. Maybe someone else is more familiar with that but I learn from seeing something and then trying different approaches based on the data.

---

<div class="post-metadata">

### Author: ![funhall](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/funhall/32/92145_2.png) [@funhall](https://community.thunkable.com/u/funhall)
#### Post date: [February 26, 2021, 4:49pm UTC](https://community.thunkable.com/t/need-help-to-download-af-pdf-that-is-a-stream-of-raw-bytes/1125447/5 "2021-02-26T16:49:10Z")

</div>

I think you have to forget about the raw file. I just need to save the pdt I get from the link in the respons from the API.  
Does that give any meaning to you?

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [February 26, 2021, 5:33pm UTC](https://community.thunkable.com/t/need-help-to-download-af-pdf-that-is-a-stream-of-raw-bytes/1125447/6 "2021-02-26T17:33:40Z")

</div>

Nope, sorry. I mean, I understand what you’re saying but I have no way to suggest anything without seeing the actual link/file.

It would be like someone saying “I’m going to receive a gift and I want you to buy a box that fits it perfectly.” How would you know what size box to buy based on only that description? 😬

---

<div class="post-metadata">

### Author: ![funhall](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/funhall/32/92145_2.png) [@funhall](https://community.thunkable.com/u/funhall)
#### Post date: [February 26, 2021, 5:40pm UTC](https://community.thunkable.com/t/need-help-to-download-af-pdf-that-is-a-stream-of-raw-bytes/1125447/7 "2021-02-26T17:40:53Z")

</div>

Hi. I cant get the file from the api because I dont know how ot works with the link i get from the API.  
But I found the docs here.  
[https://restdocs.e-conomic.com/#get-invoices-paid](https://restdocs.e-conomic.com/#get-invoices-paid)  
Hope that can specifie it for you more than I can.  
Thanks so much for helping me out

Martin

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [February 26, 2021, 5:48pm UTC](https://community.thunkable.com/t/need-help-to-download-af-pdf-that-is-a-stream-of-raw-bytes/1125447/8 "2021-02-26T17:48:29Z")

</div>

Okay, so I may have misunderstood. You’re at the point where you need to figure out how to GET the information from the API, correct? It’s not that you’ve already gotten the information and just need help saving/converting it.

I may be able to help with that.

This section of the documentation includes the GET command for invoices:

[https://restdocs.e-conomic.com/#invoices](https://restdocs.e-conomic.com/#invoices)

It only lists javascript which I’m not all that familiar with. The documentation is pretty limited compared to some APIs I’ve used. There aren’t example of how to create REST calls which is what I typically use and there aren’t examples of the JSON result which is really unfortunate because that’s the main thing I need to know to help you with the next steps. But it’s possible we can still get this to work.

Based on the javascript:

```auto
$.ajax({
    url: "https://restapi.e-conomic.com/invoices",
    dataType: "json",
    headers: {
        'X-AppSecretToken': "demo",
        'X-AgreementGrantToken': "demo",
        'Content-Type': "application/json"
    },
    type: "GET"
})
    .always(function (data) {
    $("#output").text(JSON.stringify(data, null, 4));
});

```

It looks like you’ll need a secret token and grant token. It appears you can use “demo” for both so that’s good.

**Edit:** Oh! Perfect! They have a demo url:

[https://restapi.e-conomic.com/invoices?demo=true](https://restapi.e-conomic.com/invoices?demo=true)

It returns this JSON:

```auto
{"drafts":"https://restapi.e-conomic.com/invoices/drafts?demo=true","booked":"https://restapi.e-conomic.com/invoices/booked?demo=true","paid":"https://restapi.e-conomic.com/invoices/paid?demo=true","unpaid":"https://restapi.e-conomic.com/invoices/unpaid?demo=true","overdue":"https://restapi.e-conomic.com/invoices/overdue?demo=true","notDue":"https://restapi.e-conomic.com/invoices/not-due?demo=true","sent":"https://restapi.e-conomic.com/invoices/sent?demo=true","totals":"https://restapi.e-conomic.com/invoices/totals?demo=true","self":"https://restapi.e-conomic.com/invoices?demo=true"}

```

Which when formatted at [https://jsonformatter-online.com](https://jsonformatter-online.com) looks like this:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/3/631a24a0162832e2ad3cc1a9903f35ff68f5163e.png)

The “paid” url ([https://restapi.e-conomic.com/invoices/paid?demo=true](https://restapi.e-conomic.com/invoices/paid?demo=true)) generates a long JSON response:

```auto
{"collection":[{"bookedInvoiceNumber":42,"date":"2020-04-07","currency":"DKK","exchangeRate":100.000000,"netAmount":0.00,"netAmountInBaseCurrency":0.00,"grossAmount":0.00,"grossAmountInBaseCurrency":0.00,"vatAmount":0.00,"roundingAmount":0.00,"remainder":0.00,"remainderInBaseCurrency":0.00,"dueDate":"2020-04-15","paymentTerms":{"paymentTermsNumber":1,"daysOfCredit":8,"name":"Netto 8 dage","paymentTermsType":"net","self":"https://restapi.e-conomic.com/payment-terms/1?demo=true"},"customer":{"customerNumber":12345678,"self":"https://restapi.e-conomic.com/customers/12345678?demo=true"},"recipient":{"name":"Test Firma A/S","address":"Testvej 4","zip":"7100","city":"Vejle","country":"Danmark","attention":{"customerContactNumber":501,"self":"https://restapi.e-conomic.com/customers/12345678/contacts/501?demo=true"},"vatZone":{"name":"Domestic","vatZoneNumber":1,"enabledForCustomer":true,"enabledForSupplier":true,"self":"https://restapi.e-conomic.com/vat-zones/1?demo=true"}},"notes":{"textLine1":"Booked af Henry - hb@incaptiva.dk"},"layout":{"layoutNumber":19,"self":"https://restapi.e-conomic.com/layouts/19?demo=true"},"pdf":{"download":"https://restapi.e-conomic.com/invoices/booked/42/pdf?demo=true"},"sent":"https://restapi.e-conomic.com/invoices/booked/42/sent?demo=true","self":"https://restapi.e-conomic.com/invoices/booked/42?demo=true"},{"bookedInvoiceNumber":10001,"date":"2011-10-10","currency":"DKK","exchangeRate":100.000000,"netAmount":100000.00,"netAmountInBaseCurrency":100000.00,"grossAmount":125000.00,"grossAmountInBaseCurrency":125000.00,"vatAmount":25000.00,"roundingAmount":0.00,"remainder":0.00,"remainderInBaseCurrency":0.00,"dueDate":"2011-11-09","paymentTerms":{"paymentTermsNumber":5,"daysOfCredit":30,"name":"Netto 30 dage","paymentTermsType":"net","self":"https://restapi.e-conomic.com/payment-terms/5?demo=true"},"customer":{"customerNumber":1000,"self":"https://restapi.e-conomic.com/customers/1000?demo=true"},"recipient":{"name":"Møbelfabrikken A/S","address":"Møtrikvej 1","zip":"2750","city":"Ballerup","vatZone":{"name":"Domestic","vatZoneNumber":1,"enabledForCustomer":true,"enabledForSupplier":true,"self":"https://restapi.e-conomic.com/vat-zones/1?demo=true"}},"layout":{"layoutNumber":19,"self":"https://restapi.e-conomic.com/layouts/19?demo=true"},"pdf":{"download":"https://restapi.e-conomic.com/invoices/booked/10001/pdf?demo=true"},"sent":"https://restapi.e-conomic.com/invoices/booked/10001/sent?demo=true","self":"https://restapi.e-conomic.com/invoices/booked/10001?demo=true"},{"bookedInvoiceNumber":10002,"date":"2011-10-31","currency":"DKK","exchangeRate":100.000000,"netAmount":50000.00,"netAmountInBaseCurrency":50000.00,"grossAmount":62500.00,"grossAmountInBaseCurrency":62500.00,"vatAmount":12500.00,"roundingAmount":0.00,"remainder":0.00,"remainderInBaseCurrency":0.00,"dueDate":"2011-11-30","paymentTerms":{"paymentTermsNumber":5,"daysOfCredit":30,"name":"Netto 30 dage","paymentTermsType":"net","self":"https://restapi.e-conomic.com/payment-terms/5?demo=true"},"customer":{"customerNumber":1001,"self":"https://restapi.e-conomic.com/customers/1001?demo=true"},"recipient":{"name":"IT Specialisterne ApS","address":"Idevej 7","zip":"8850","city":"Bjerringbro","vatZone":{"name":"Domestic","vatZoneNumber":1,"enabledForCustomer":true,"enabledForSupplier":true,"self":"https://restapi.e-conomic.com/vat-zones/1?demo=true"}},"layout":{"layoutNumber":19,"self":"https://restapi.e-conomic.com/layouts/19?demo=true"},"pdf":{"download":"https://restapi.e-conomic.com/invoices/booked/10002/pdf?demo=true"},"sent":"https://restapi.e-conomic.com/invoices/booked/10002/sent?demo=true","self":"https://restapi.e-conomic.com/invoices/booked/10002?demo=true"},{"bookedInvoiceNumber":10003,"date":"2011-11-20","currency":"DKK","exchangeRate":100.000000,"netAmount":150000.00,"netAmountInBaseCurrency":150000.00,"grossAmount":187500.00,"grossAmountInBaseCurrency":187500.00,"vatAmount":37500.00,"roundingAmount":0.00,"remainder":0.00,"remainderInBaseCurrency":0.00,"dueDate":"2011-12-20","paymentTerms":{"paymentTermsNumber":5,"daysOfCredit":30,"name":"Netto 30 dage","paymentTermsType":"net","self":"https://restapi.e-conomic.com/payment-terms/5?demo=true"},"customer":{"customerNumber":1005,"self":"https://restapi.e-conomic.com/customers/1005?demo=true"},"recipient":{"name":"TopTeam","address":"Wildersgade 10B","zip":"1408","city":"København K","vatZone":{"name":"Domestic","vatZoneNumber":1,"enabledForCustomer":true,"enabledForSupplier":true,"self":"https://restapi.e-conomic.com/vat-zones/1?demo=true"}},"layout":{"layoutNumber":19,"self":"https://restapi.e-conomic.com/layouts/19?demo=true"},"pdf":{"download":"https://restapi.e-conomic.com/invoices/booked/10003/pdf?demo=true"},"sent":"https://restapi.e-conomic.com/invoices/booked/10003/sent?demo=true","self":"https://restapi.e-conomic.com/invoices/booked/10003?demo=true"},{"bookedInvoiceNumber":10004,"date":"2011-11-30","currency":"DKK","exchangeRate":100.000000,"netAmount":120000.00,"netAmountInBaseCurrency":120000.00,"grossAmount":150000.00,"grossAmountInBaseCurrency":150000.00,"vatAmount":30000.00,"roundingAmount":0.00,"remainder":0.00,"remainderInBaseCurrency":0.00,"dueDate":"2011-12-30","paymentTerms":{"paymentTermsNumber":5,"daysOfCredit":30,"name":"Netto 30 dage","paymentTermsType":"net","self":"https://restapi.e-conomic.com/payment-terms/5?demo=true"},"customer":{"customerNumber":1007,"self":"https://restapi.e-conomic.com/customers/1007?demo=true"},"recipient":{"name":"Andersens Eftf. A/S","address":"Wildersgade 10B","zip":"1408","city":"København K","vatZone":{"name":"Domestic","vatZoneNumber":1,"enabledForCustomer":true,"enabledForSupplier":true,"self":"https://restapi.e-conomic.com/vat-zones/1?demo=true"}},"layout":{"layoutNumber":19,"self":"https://restapi.e-conomic.com/layouts/19?demo=true"},"pdf":{"download":"https://restapi.e-conomic.com/invoices/booked/10004/pdf?demo=true"},"sent":"https://restapi.e-conomic.com/invoices/booked/10004/sent?demo=true","self":"https://restapi.e-conomic.com/invoices/booked/10004?demo=true"},{"bookedInvoiceNumber":10005,"date":"2011-12-20","currency":"DKK","exchangeRate":100.000000,"netAmount":150000.00,"netAmountInBaseCurrency":150000.00,"grossAmount":187500.00,"grossAmountInBaseCurrency":187500.00,"vatAmount":37500.00,"roundingAmount":0.00,"remainder":0.00,"remainderInBaseCurrency":0.00,"dueDate":"2012-01-19","paymentTerms":{"paymentTermsNumber":5,"daysOfCredit":30,"name":"Netto 30 dage","paymentTermsType":"net","self":"https://restapi.e-conomic.com/payment-terms/5?demo=true"},"customer":{"customerNumber":1005,"self":"https://restapi.e-conomic.com/customers/1005?demo=true"},"recipient":{"name":"TopTeam","address":"Wildersgade 10B","zip":"1408","city":"København K","vatZone":{"name":"Domestic","vatZoneNumber":1,"enabledForCustomer":true,"enabledForSupplier":true,"self":"https://restapi.e-conomic.com/vat-zones/1?demo=true"}},"layout":{"layoutNumber":19,"self":"https://restapi.e-conomic.com/layouts/19?demo=true"},"pdf":{"download":"https://restapi.e-conomic.com/invoices/booked/10005/pdf?demo=true"},"sent":"https://restapi.e-conomic.com/invoices/booked/10005/sent?demo=true","self":"https://restapi.e-conomic.com/invoices/booked/10005?demo=true"},{"bookedInvoiceNumber":10006,"date":"2012-02-28","currency":"DKK","exchangeRate":100.000000,"netAmount":160000.00,"netAmountInBaseCurrency":160000.00,"grossAmount":200000.00,"grossAmountInBaseCurrency":200000.00,"vatAmount":40000.00,"roundingAmount":0.00,"remainder":0.00,"remainderInBaseCurrency":0.00,"dueDate":"2012-03-29","paymentTerms":{"paymentTermsNumber":5,"daysOfCredit":30,"name":"Netto 30 dage","paymentTermsType":"net","self":"https://restapi.e-conomic.com/payment-terms/5?demo=true"},"customer":{"customerNumber":1003,"self":"https://restapi.e-conomic.com/customers/1003?demo=true"},"recipient":{"name":"Storeskolen","address":"Byvej 4","zip":"3450","city":"Allerød","vatZone":{"name":"Domestic","vatZoneNumber":1,"enabledForCustomer":true,"enabledForSupplier":true,"self":"https://restapi.e-conomic.com/vat-zones/1?demo=true"}},"layout":{"layoutNumber":19,"self":"https://restapi.e-conomic.com/layouts/19?demo=true"},"pdf":{"download":"https://restapi.e-conomic.com/invoices/booked/10006/pdf?demo=true"},"sent":"https://restapi.e-conomic.com/invoices/booked/10006/sent?demo=true","self":"https://restapi.e-conomic.com/invoices/booked/10006?demo=true"},{"bookedInvoiceNumber":10007,"date":"2012-03-31","currency":"DKK","exchangeRate":100.000000,"netAmount":250000.00,"netAmountInBaseCurrency":250000.00,"grossAmount":312500.00,"grossAmountInBaseCurrency":312500.00,"vatAmount":62500.00,"roundingAmount":0.00,"remainder":0.00,"remainderInBaseCurrency":0.00,"dueDate":"2012-04-30","paymentTerms":{"paymentTermsNumber":5,"daysOfCredit":30,"name":"Netto 30 dage","paymentTermsType":"net","self":"https://restapi.e-conomic.com/payment-terms/5?demo=true"},"customer":{"customerNumber":1000,"self":"https://restapi.e-conomic.com/customers/1000?demo=true"},"recipient":{"name":"Møbelfabrikken A/S","address":"Møtrikvej 1","zip":"2750","city":"Ballerup","vatZone":{"name":"Domestic","vatZoneNumber":1,"enabledForCustomer":true,"enabledForSupplier":true,"self":"https://restapi.e-conomic.com/vat-zones/1?demo=true"}},"layout":{"layoutNumber":19,"self":"https://restapi.e-conomic.com/layouts/19?demo=true"},"pdf":{"download":"https://restapi.e-conomic.com/invoices/booked/10007/pdf?demo=true"},"sent":"https://restapi.e-conomic.com/invoices/booked/10007/sent?demo=true","self":"https://restapi.e-conomic.com/invoices/booked/10007?demo=true"},{"bookedInvoiceNumber":10008,"date":"2012-03-31","currency":"DKK","exchangeRate":100.000000,"netAmount":29350.00,"netAmountInBaseCurrency":29350.00,"grossAmount":36687.50,"grossAmountInBaseCurrency":36687.50,"vatAmount":7337.50,"roundingAmount":0.00,"remainder":0.00,"remainderInBaseCurrency":0.00,"dueDate":"2012-04-30","paymentTerms":{"paymentTermsNumber":5,"daysOfCredit":30,"name":"Netto 30 dage","paymentTermsType":"net","self":"https://restapi.e-conomic.com/payment-terms/5?demo=true"},"customer":{"customerNumber":1004,"self":"https://restapi.e-conomic.com/customers/1004?demo=true"},"recipient":{"name":"Lilleskolen","address":"Gl. Kongevej 121","zip":"2850","city":"Nærum","vatZone":{"name":"Domestic","vatZoneNumber":1,"enabledForCustomer":true,"enabledForSupplier":true,"self":"https://restapi.e-conomic.com/vat-zones/1?demo=true"}},"layout":{"layoutNumber":19,"self":"https://restapi.e-conomic.com/layouts/19?demo=true"},"pdf":{"download":"https://restapi.e-conomic.com/invoices/booked/10008/pdf?demo=true"},"sent":"https://restapi.e-conomic.com/invoices/booked/10008/sent?demo=true","self":"https://restapi.e-conomic.com/invoices/booked/10008?demo=true"},{"bookedInvoiceNumber":10009,"date":"2012-05-31","currency":"DKK","exchangeRate":100.000000,"netAmount":175000.00,"netAmountInBaseCurrency":175000.00,"grossAmount":218750.00,"grossAmountInBaseCurrency":218750.00,"vatAmount":43750.00,"roundingAmount":0.00,"remainder":0.00,"remainderInBaseCurrency":0.00,"dueDate":"2012-06-30","paymentTerms":{"paymentTermsNumber":5,"daysOfCredit":30,"name":"Netto 30 dage","paymentTermsType":"net","self":"https://restapi.e-conomic.com/payment-terms/5?demo=true"},"customer":{"customerNumber":1005,"self":"https://restapi.e-conomic.com/customers/1005?demo=true"},"recipient":{"name":"TopTeam","address":"Wildersgade 10B","zip":"1408","city":"København K","vatZone":{"name":"Domestic","vatZoneNumber":1,"enabledForCustomer":true,"enabledForSupplier":true,"self":"https://restapi.e-conomic.com/vat-zones/1?demo=true"}},"layout":{"layoutNumber":19,"self":"https://restapi.e-conomic.com/layouts/19?demo=true"},"pdf":{"download":"https://restapi.e-conomic.com/invoices/booked/10009/pdf?demo=true"},"sent":"https://restapi.e-conomic.com/invoices/booked/10009/sent?demo=true","self":"https://restapi.e-conomic.com/invoices/booked/10009?demo=true"},{"bookedInvoiceNumber":10010,"date":"2012-06-30","currency":"DKK","exchangeRate":100.000000,"netAmount":202500.00,"netAmountInBaseCurrency":202500.00,"grossAmount":253125.00,"grossAmountInBaseCurrency":253125.00,"vatAmount":50625.00,"roundingAmount":0.00,"remainder":0.00,"remainderInBaseCurrency":0.00,"dueDate":"2012-07-30","paymentTerms":{"paymentTermsNumber":5,"daysOfCredit":30,"name":"Netto 30 dage","paymentTermsType":"net","self":"https://restapi.e-conomic.com/payment-terms/5?demo=true"},"customer":{"customerNumber":1000,"self":"https://restapi.e-conomic.com/customers/1000?demo=true"},"recipient":{"name":"Møbelfabrikken A/S","address":"Møtrikvej 1","zip":"2750","city":"Ballerup","vatZone":{"name":"Domestic","vatZoneNumber":1,"enabledForCustomer":true,"enabledForSupplier":true,"self":"https://restapi.e-conomic.com/vat-zones/1?demo=true"}},"layout":{"layoutNumber":19,"self":"https://restapi.e-conomic.com/layouts/19?demo=true"},"pdf":{"download":"https://restapi.e-conomic.com/invoices/booked/10010/pdf?demo=true"},"sent":"https://restapi.e-conomic.com/invoices/booked/10010/sent?demo=true","self":"https://restapi.e-conomic.com/invoices/booked/10010?demo=true"},{"bookedInvoiceNumber":10011,"date":"2012-06-30","currency":"DKK","exchangeRate":100.000000,"netAmount":250000.00,"netAmountInBaseCurrency":250000.00,"grossAmount":312500.00,"grossAmountInBaseCurrency":312500.00,"vatAmount":62500.00,"roundingAmount":0.00,"remainder":0.00,"remainderInBaseCurrency":0.00,"dueDate":"2012-07-30","paymentTerms":{"paymentTermsNumber":5,"daysOfCredit":30,"name":"Netto 30 dage","paymentTermsType":"net","self":"https://restapi.e-conomic.com/payment-terms/5?demo=true"},"customer":{"customerNumber":1001,"self":"https://restapi.e-conomic.com/customers/1001?demo=true"},"recipient":{"name":"IT Specialisterne ApS","address":"Idevej 7","zip":"8850","city":"Bjerringbro","vatZone":{"name":"Domestic","vatZoneNumber":1,"enabledForCustomer":true,"enabledForSupplier":true,"self":"https://restapi.e-conomic.com/vat-zones/1?demo=true"}},"layout":{"layoutNumber":19,"self":"https://restapi.e-conomic.com/layouts/19?demo=true"},"pdf":{"download":"https://restapi.e-conomic.com/invoices/booked/10011/pdf?demo=true"},"sent":"https://restapi.e-conomic.com/invoices/booked/10011/sent?demo=true","self":"https://restapi.e-conomic.com/invoices/booked/10011?demo=true"},{"bookedInvoiceNumber":10012,"date":"2012-06-30","currency":"DKK","exchangeRate":100.000000,"netAmount":75000.00,"netAmountInBaseCurrency":75000.00,"grossAmount":93750.00,"grossAmountInBaseCurrency":93750.00,"vatAmount":18750.00,"roundingAmount":0.00,"remainder":0.00,"remainderInBaseCurrency":0.00,"dueDate":"2012-07-30","paymentTerms":{"paymentTermsNumber":5,"daysOfCredit":30,"name":"Netto 30 dage","paymentTermsType":"net","self":"https://restapi.e-conomic.com/payment-terms/5?demo=true"},"customer":{"customerNumber":1002,"self":"https://restapi.e-conomic.com/customers/1002?demo=true"},"recipient":{"name":"Ejendomsmæglerne BoBedre","address":"Bymidten 2","zip":"3600","city":"Frederikssund","vatZone":{"name":"Domestic","vatZoneNumber":1,"enabledForCustomer":true,"enabledForSupplier":true,"self":"https://restapi.e-conomic.com/vat-zones/1?demo=true"}},"layout":{"layoutNumber":19,"self":"https://restapi.e-conomic.com/layouts/19?demo=true"},"pdf":{"download":"https://restapi.e-conomic.com/invoices/booked/10012/pdf?demo=true"},"sent":"https://restapi.e-conomic.com/invoices/booked/10012/sent?demo=true","self":"https://restapi.e-conomic.com/invoices/booked/10012?demo=true"},{"bookedInvoiceNumber":10013,"date":"2012-09-30","currency":"DKK","exchangeRate":100.000000,"netAmount":18000.00,"netAmountInBaseCurrency":18000.00,"grossAmount":22500.00,"grossAmountInBaseCurrency":22500.00,"vatAmount":4500.00,"roundingAmount":0.00,"remainder":0.00,"remainderInBaseCurrency":0.00,"dueDate":"2012-10-30","paymentTerms":{"paymentTermsNumber":5,"daysOfCredit":30,"name":"Netto 30 dage","paymentTermsType":"net","self":"https://restapi.e-conomic.com/payment-terms/5?demo=true"},"customer":{"customerNumber":1001,"self":"https://restapi.e-conomic.com/customers/1001?demo=true"},"recipient":{"name":"IT Specialisterne ApS","address":"Idevej 7","zip":"8850","city":"Bjerringbro","vatZone":{"name":"Domestic","vatZoneNumber":1,"enabledForCustomer":true,"enabledForSupplier":true,"self":"https://restapi.e-conomic.com/vat-zones/1?demo=true"}},"layout":{"layoutNumber":19,"self":"https://restapi.e-conomic.com/layouts/19?demo=true"},"pdf":{"download":"https://restapi.e-conomic.com/invoices/booked/10013/pdf?demo=true"},"sent":"https://restapi.e-conomic.com/invoices/booked/10013/sent?demo=true","self":"https://restapi.e-conomic.com/invoices/booked/10013?demo=true"},{"bookedInvoiceNumber":10014,"date":"2012-09-30","currency":"DKK","exchangeRate":100.000000,"netAmount":125000.00,"netAmountInBaseCurrency":125000.00,"grossAmount":156250.00,"grossAmountInBaseCurrency":156250.00,"vatAmount":31250.00,"roundingAmount":0.00,"remainder":0.00,"remainderInBaseCurrency":0.00,"dueDate":"2012-10-30","paymentTerms":{"paymentTermsNumber":5,"daysOfCredit":30,"name":"Netto 30 dage","paymentTermsType":"net","self":"https://restapi.e-conomic.com/payment-terms/5?demo=true"},"customer":{"customerNumber":1002,"self":"https://restapi.e-conomic.com/customers/1002?demo=true"},"recipient":{"name":"Ejendomsmæglerne BoBedre","address":"Bymidten 2","zip":"3600","city":"Frederikssund","vatZone":{"name":"Domestic","vatZoneNumber":1,"enabledForCustomer":true,"enabledForSupplier":true,"self":"https://restapi.e-conomic.com/vat-zones/1?demo=true"}},"layout":{"layoutNumber":19,"self":"https://restapi.e-conomic.com/layouts/19?demo=true"},"pdf":{"download":"https://restapi.e-conomic.com/invoices/booked/10014/pdf?demo=true"},"sent":"https://restapi.e-conomic.com/invoices/booked/10014/sent?demo=true","self":"https://restapi.e-conomic.com/invoices/booked/10014?demo=true"},{"bookedInvoiceNumber":10015,"date":"2012-11-30","currency":"DKK","exchangeRate":100.000000,"netAmount":60000.00,"netAmountInBaseCurrency":60000.00,"grossAmount":75000.00,"grossAmountInBaseCurrency":75000.00,"vatAmount":15000.00,"roundingAmount":0.00,"remainder":0.00,"remainderInBaseCurrency":0.00,"dueDate":"2012-12-30","paymentTerms":{"paymentTermsNumber":5,"daysOfCredit":30,"name":"Netto 30 dage","paymentTermsType":"net","self":"https://restapi.e-conomic.com/payment-terms/5?demo=true"},"customer":{"customerNumber":1005,"self":"https://restapi.e-conomic.com/customers/1005?demo=true"},"recipient":{"name":"TopTeam","address":"Wildersgade 10B","zip":"1408","city":"København K","vatZone":{"name":"Domestic","vatZoneNumber":1,"enabledForCustomer":true,"enabledForSupplier":true,"self":"https://restapi.e-conomic.com/vat-zones/1?demo=true"}},"layout":{"layoutNumber":19,"self":"https://restapi.e-conomic.com/layouts/19?demo=true"},"pdf":{"download":"https://restapi.e-conomic.com/invoices/booked/10015/pdf?demo=true"},"sent":"https://restapi.e-conomic.com/invoices/booked/10015/sent?demo=true","self":"https://restapi.e-conomic.com/invoices/booked/10015?demo=true"},{"bookedInvoiceNumber":10016,"date":"2012-11-30","currency":"DKK","exchangeRate":100.000000,"netAmount":95000.00,"netAmountInBaseCurrency":95000.00,"grossAmount":118750.00,"grossAmountInBaseCurrency":118750.00,"vatAmount":23750.00,"roundingAmount":0.00,"remainder":0.00,"remainderInBaseCurrency":0.00,"dueDate":"2012-12-30","paymentTerms":{"paymentTermsNumber":5,"daysOfCredit":30,"name":"Netto 30 dage","paymentTermsType":"net","self":"https://restapi.e-conomic.com/payment-terms/5?demo=true"},"customer":{"customerNumber":1004,"self":"https://restapi.e-conomic.com/customers/1004?demo=true"},"recipient":{"name":"Lilleskolen","address":"Gl. Kongevej 121","zip":"2850","city":"Nærum","vatZone":{"name":"Domestic","vatZoneNumber":1,"enabledForCustomer":true,"enabledForSupplier":true,"self":"https://restapi.e-conomic.com/vat-zones/1?demo=true"}},"layout":{"layoutNumber":19,"self":"https://restapi.e-conomic.com/layouts/19?demo=true"},"pdf":{"download":"https://restapi.e-conomic.com/invoices/booked/10016/pdf?demo=true"},"sent":"https://restapi.e-conomic.com/invoices/booked/10016/sent?demo=true","self":"https://restapi.e-conomic.com/invoices/booked/10016?demo=true"},{"bookedInvoiceNumber":10017,"date":"2012-12-31","currency":"DKK","exchangeRate":100.000000,"netAmount":155000.00,"netAmountInBaseCurrency":155000.00,"grossAmount":193750.00,"grossAmountInBaseCurrency":193750.00,"vatAmount":38750.00,"roundingAmount":0.00,"remainder":0.00,"remainderInBaseCurrency":0.00,"dueDate":"2013-01-30","paymentTerms":{"paymentTermsNumber":5,"daysOfCredit":30,"name":"Netto 30 dage","paymentTermsType":"net","self":"https://restapi.e-conomic.com/payment-terms/5?demo=true"},"customer":{"customerNumber":1001,"self":"https://restapi.e-conomic.com/customers/1001?demo=true"},"recipient":{"name":"IT Specialisterne ApS","address":"Idevej 7","zip":"8850","city":"Bjerringbro","vatZone":{"name":"Domestic","vatZoneNumber":1,"enabledForCustomer":true,"enabledForSupplier":true,"self":"https://restapi.e-conomic.com/vat-zones/1?demo=true"}},"layout":{"layoutNumber":19,"self":"https://restapi.e-conomic.com/layouts/19?demo=true"},"pdf":{"download":"https://restapi.e-conomic.com/invoices/booked/10017/pdf?demo=true"},"sent":"https://restapi.e-conomic.com/invoices/booked/10017/sent?demo=true","self":"https://restapi.e-conomic.com/invoices/booked/10017?demo=true"},{"bookedInvoiceNumber":10018,"date":"2012-12-31","currency":"DKK","exchangeRate":100.000000,"netAmount":35000.00,"netAmountInBaseCurrency":35000.00,"grossAmount":43750.00,"grossAmountInBaseCurrency":43750.00,"vatAmount":8750.00,"roundingAmount":0.00,"remainder":0.00,"remainderInBaseCurrency":0.00,"dueDate":"2013-01-30","paymentTerms":{"paymentTermsNumber":5,"daysOfCredit":30,"name":"Netto 30 dage","paymentTermsType":"net","self":"https://restapi.e-conomic.com/payment-terms/5?demo=true"},"customer":{"customerNumber":1000,"self":"https://restapi.e-conomic.com/customers/1000?demo=true"},"recipient":{"name":"Møbelfabrikken A/S","address":"Møtrikvej 1","zip":"2750","city":"Ballerup","vatZone":{"name":"Domestic","vatZoneNumber":1,"enabledForCustomer":true,"enabledForSupplier":true,"self":"https://restapi.e-conomic.com/vat-zones/1?demo=true"}},"layout":{"layoutNumber":19,"self":"https://restapi.e-conomic.com/layouts/19?demo=true"},"pdf":{"download":"https://restapi.e-conomic.com/invoices/booked/10018/pdf?demo=true"},"sent":"https://restapi.e-conomic.com/invoices/booked/10018/sent?demo=true","self":"https://restapi.e-conomic.com/invoices/booked/10018?demo=true"},{"bookedInvoiceNumber":10019,"date":"2013-01-31","currency":"DKK","exchangeRate":100.000000,"netAmount":135000.00,"netAmountInBaseCurrency":135000.00,"grossAmount":168750.00,"grossAmountInBaseCurrency":168750.00,"vatAmount":33750.00,"roundingAmount":0.00,"remainder":0.00,"remainderInBaseCurrency":0.00,"dueDate":"2013-03-02","paymentTerms":{"paymentTermsNumber":5,"daysOfCredit":30,"name":"Netto 30 dage","paymentTermsType":"net","self":"https://restapi.e-conomic.com/payment-terms/5?demo=true"},"customer":{"customerNumber":1000,"self":"https://restapi.e-conomic.com/customers/1000?demo=true"},"recipient":{"name":"Møbelfabrikken A/S","address":"Møtrikvej 1","zip":"2750","city":"Ballerup","vatZone":{"name":"Domestic","vatZoneNumber":1,"enabledForCustomer":true,"enabledForSupplier":true,"self":"https://restapi.e-conomic.com/vat-zones/1?demo=true"}},"layout":{"layoutNumber":19,"self":"https://restapi.e-conomic.com/layouts/19?demo=true"},"pdf":{"download":"https://restapi.e-conomic.com/invoices/booked/10019/pdf?demo=true"},"sent":"https://restapi.e-conomic.com/invoices/booked/10019/sent?demo=true","self":"https://restapi.e-conomic.com/invoices/booked/10019?demo=true"}],"pagination":{"maxPageSizeAllowed":1000,"skipPages":0,"pageSize":20,"results":81,"resultsWithoutFilter":81,"firstPage":"https://restapi.e-conomic.com/invoices/paid?demo=true&skippages=0&pagesize=20","nextPage":"https://restapi.e-conomic.com/invoices/paid?demo=true&skippages=1&pagesize=20","lastPage":"https://restapi.e-conomic.com/invoices/paid?demo=true&skippages=4&pagesize=20"},"self":"https://restapi.e-conomic.com/invoices/paid?demo=true"}

```

Which when formatted looks like this:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/c/fc6ad75c61aba05e621bc3607c85e0e643b4679b.png)

And right there at the end is the PDF link ([https://restapi.e-conomic.com/invoices/booked/42/pdf?demo=true](https://restapi.e-conomic.com/invoices/booked/42/pdf?demo=true)).

So now it’s just a matter of making a GET command in Thunkable and parsing the JSON data to find that “pdf” property.

You’ll need to get the “download” property of the “pdf” property of the first list item of the “collection” property of the JSON object.

If your head is spinning, welcome to the world of APIs and JSON!!! It took me a good ten hours or so of playing around with this stuff to really start to understand it.

---

<div class="post-metadata">

### Author: ![funhall](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/funhall/32/92145_2.png) [@funhall](https://community.thunkable.com/u/funhall)
#### Post date: [February 26, 2021, 6:30pm UTC](https://community.thunkable.com/t/need-help-to-download-af-pdf-that-is-a-stream-of-raw-bytes/1125447/9 "2021-02-26T18:30:57Z")

</div>

Yes i have no problems gerning This info. I just don’t know what to do with it.

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [February 26, 2021, 6:53pm UTC](https://community.thunkable.com/t/need-help-to-download-af-pdf-that-is-a-stream-of-raw-bytes/1125447/10 "2021-02-26T18:53:52Z")

</div>

There are four main steps to using an API in Thunkable:

1. Connecting to the API by entering a url in a browser (e.g. Chrome; this step actually isn’t done inside of Thunkable) and viewing JSON data  
[https://restapi.e-conomic.com/invoices/paid?demo=true](https://restapi.e-conomic.com/invoices/paid?demo=true) is an example of that but it uses demo data
2. Connecting to the API url using Thunkable Web API URL and Web API GET blocks and retrieving JSON data
3. Parsing the JSON data
4. Deciding what to do with specific JSON data

If you’re able to do #1, it would speed things along if you can PM me with the url you’re using.

Figuring out #2 and #3 are relatively straightfoward and I can provide a screenshot for those. But it won’t actually _work_ without the url from #1.

As far as #4 goes, well, if you have a link to a PDF then you have to decide what you want to do with that link or the file it points to. You can email or text it to someone, you can display it in the app, or you can upload it somewhere.

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [February 26, 2021, 7:03pm UTC](https://community.thunkable.com/t/need-help-to-download-af-pdf-that-is-a-stream-of-raw-bytes/1125447/11 "2021-02-26T19:03:14Z")

</div>

Here’s a project I made that parses the JSON data from the demo url provided by the company:

[https://x.thunkable.com/copy/f7343bf92bcc98848fe698cf6c94a0d3](https://x.thunkable.com/copy/f7343bf92bcc98848fe698cf6c94a0d3)

It attempts to get the “download” property I mentioned above and store that url in an image, a PDF reader, and a label.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/b/1b194b6d575048ced08d2d09052e34af6dbf2ea2.png)

---

<div class="post-metadata">

### Author: ![funhall](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/funhall/32/92145_2.png) [@funhall](https://community.thunkable.com/u/funhall)
#### Post date: [February 26, 2021, 7:22pm UTC](https://community.thunkable.com/t/need-help-to-download-af-pdf-that-is-a-stream-of-raw-bytes/1125447/12 "2021-02-26T19:22:27Z")

</div>

Ues that looks right.  
I just got the response where the download PDF link is also.  
But I am sure you are on the right way. How does the blocks looks for that you mentioned ???

{“collection”:[{“bookedInvoiceNumber”:5,“date”:“2021-02-26”,“currency”:“DKK”,“exchangeRate”:100.000000,“netAmount”:268.80,“netAmountInBaseCurrency”:268.80,“grossAmount”:336.00,“grossAmountInBaseCurrency”:336.00,“vatAmount”:67.20,“roundingAmount”:0.00,“remainder”:0.00,“remainderInBaseCurrency”:0.00,“dueDate”:“2021-02-26”,“paymentTerms”:{“paymentTermsNumber”:3,“daysOfCredit”:0,“name”:“Til omgående betaling”,“paymentTermsType”:“net”,“self”:“[https://restapi.e-conomic.com/payment-terms/3"},“customer”:{“customerNumber”:28193617,“self”:“https://restapi.e-conomic.com/customers/28193617”},“recipient”:{“name”:"Martin](https://restapi.e-conomic.com/payment-terms/3%22%7D,%22customer%22:%7B%22customerNumber%22:28193617,%22self%22:%22https://restapi.e-conomic.com/customers/28193617%22%7D,%22recipient%22:%7B%22name%22:%22Martin) test”,“address”:“Skoven 5”,“zip”:“8800”,“city”:“Viborg”,“vatZone”:{“name”:“Domestic”,“vatZoneNumber”:1,“enabledForCustomer”:true,“enabledForSupplier”:true,“self”:“[https://restapi.e-conomic.com/vat-zones/1"}},“layout”:{“layoutNumber”:18,“self”:“https://restapi.e-conomic.com/layouts/18”},“pdf”:{“download”:“https://restapi.e-conomic.com/invoices/booked/5/pdf”},“sent”:“https://restapi.e-conomic.com/invoices/booked/5/sent”,“self”:“https://restapi.e-conomic.com/invoices/booked/5”},{“bookedInvoiceNumber”:6,“date”:“2021-02-26”,“currency”:“DKK”,“exchangeRate”:100.000000,“netAmount”:38.40,“netAmountInBaseCurrency”:38.40,“grossAmount”:48.00,“grossAmountInBaseCurrency”:48.00,“vatAmount”:9.60,“roundingAmount”:0.00,“remainder”:48.00,“remainderInBaseCurrency”:48.00,“dueDate”:“2021-02-26”,“paymentTerms”:{“paymentTermsNumber”:3,“daysOfCredit”:0,“name”:"Til](https://restapi.e-conomic.com/vat-zones/1%22%7D%7D,%22layout%22:%7B%22layoutNumber%22:18,%22self%22:%22https://restapi.e-conomic.com/layouts/18%22%7D,%22pdf%22:%7B%22download%22:%22https://restapi.e-conomic.com/invoices/booked/5/pdf%22%7D,%22sent%22:%22https://restapi.e-conomic.com/invoices/booked/5/sent%22,%22self%22:%22https://restapi.e-conomic.com/invoices/booked/5%22%7D,%7B%22bookedInvoiceNumber%22:6,%22date%22:%222021-02-26%22,%22currency%22:%22DKK%22,%22exchangeRate%22:100.000000,%22netAmount%22:38.40,%22netAmountInBaseCurrency%22:38.40,%22grossAmount%22:48.00,%22grossAmountInBaseCurrency%22:48.00,%22vatAmount%22:9.60,%22roundingAmount%22:0.00,%22remainder%22:48.00,%22remainderInBaseCurrency%22:48.00,%22dueDate%22:%222021-02-26%22,%22paymentTerms%22:%7B%22paymentTermsNumber%22:3,%22daysOfCredit%22:0,%22name%22:%22Til) omgående betaling”,“paymentTermsType”:“net”,“self”:“[https://restapi.e-conomic.com/payment-terms/3"},“customer”:{“customerNumber”:28193617,“self”:“https://restapi.e-conomic.com/customers/28193617”},“recipient”:{“name”:"Martin](https://restapi.e-conomic.com/payment-terms/3%22%7D,%22customer%22:%7B%22customerNumber%22:28193617,%22self%22:%22https://restapi.e-conomic.com/customers/28193617%22%7D,%22recipient%22:%7B%22name%22:%22Martin) test”,“address”:“Skoven 5”,“zip”:“8800”,“city”:“Viborg”,“vatZone”:{“name”:“Domestic”,“vatZoneNumber”:1,“enabledForCustomer”:true,“enabledForSupplier”:true,“self”:“[https://restapi.e-conomic.com/vat-zones/1"}},“layout”:{“layoutNumber”:18,“self”:“https://restapi.e-conomic.com/layouts/18”},“pdf”:{“download”:“https://restapi.e-conomic.com/invoices/booked/6/pdf”},“sent”:“https://restapi.e-conomic.com/invoices/booked/6/sent”,“self”:“https://restapi.e-conomic.com/invoices/booked/6”}],“pagination”:{“maxPageSizeAllowed”:1000,“skipPages”:0,“pageSize”:20,“results”:2,“resultsWithoutFilter”:2,“firstPage”:“https://restapi.e-conomic.com/customers/28193617/invoices/booked?skippages=0&pagesize=20”,“lastPage”:“https://restapi.e-conomic.com/customers/28193617/invoices/booked?skippages=0&pagesize=20”},“self”:"https://restapi.e-conomic.com/customers/28193617/invoices/booked](https://restapi.e-conomic.com/vat-zones/1%22%7D%7D,%22layout%22:%7B%22layoutNumber%22:18,%22self%22:%22https://restapi.e-conomic.com/layouts/18%22%7D,%22pdf%22:%7B%22download%22:%22https://restapi.e-conomic.com/invoices/booked/6/pdf%22%7D,%22sent%22:%22https://restapi.e-conomic.com/invoices/booked/6/sent%22,%22self%22:%22https://restapi.e-conomic.com/invoices/booked/6%22%7D%5D,%22pagination%22:%7B%22maxPageSizeAllowed%22:1000,%22skipPages%22:0,%22pageSize%22:20,%22results%22:2,%22resultsWithoutFilter%22:2,%22firstPage%22:%22https://restapi.e-conomic.com/customers/28193617/invoices/booked?skippages=0&pagesize=20%22,%22lastPage%22:%22https://restapi.e-conomic.com/customers/28193617/invoices/booked?skippages=0&pagesize=20%22%7D,%22self%22:%22https://restapi.e-conomic.com/customers/28193617/invoices/booked)”}

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [February 26, 2021, 7:25pm UTC](https://community.thunkable.com/t/need-help-to-download-af-pdf-that-is-a-stream-of-raw-bytes/1125447/13 "2021-02-26T19:25:07Z")

</div>

> [@funhall](#):
>
> How does the blocks looks for that you mentioned ???

Did you open the project I created? It has the blocks I used. Here you go:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/0/7040aa65d6e06144a685c75c5cb9b81c209a1b6e.png)

The JSON you posted above is not a full valid response so I can’t do anything with it. It’s probably missing some characters. Hopefully having the blocks in my demo project helps you figure it out. If not, you can either post the url you are using to get the JSON or you can post the full JSON response text.

---

<div class="post-metadata">

### Author: ![funhall](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/funhall/32/92145_2.png) [@funhall](https://community.thunkable.com/u/funhall)
#### Post date: [February 26, 2021, 7:50pm UTC](https://community.thunkable.com/t/need-help-to-download-af-pdf-that-is-a-stream-of-raw-bytes/1125447/14 "2021-02-26T19:50:34Z")

</div>

i will try it tanks you. I will give you a status.  
Thanks again

---

<div class="post-metadata">

### Author: ![funhall](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/funhall/32/92145_2.png) [@funhall](https://community.thunkable.com/u/funhall)
#### Post date: [February 26, 2021, 10:37pm UTC](https://community.thunkable.com/t/need-help-to-download-af-pdf-that-is-a-stream-of-raw-bytes/1125447/15 "2021-02-26T22:37:21Z")

</div>

hi. Do I have to have the Image also. Does it have a meaning that it is there?  
The is crashing when I put the URL into the pdf reader.  
I have the right URL in the tes\_input 4 field.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/0/b0243f5ce62dcef4f81fbf3dec2492d1528c187a.png)  
And do I have to get the url directly from the API or can I save it and use it in a list later like I have done in this example??

---

<div class="post-metadata">

### Author: ![funhall](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/funhall/32/92145_2.png) [@funhall](https://community.thunkable.com/u/funhall)
#### Post date: [February 26, 2021, 10:47pm UTC](https://community.thunkable.com/t/need-help-to-download-af-pdf-that-is-a-stream-of-raw-bytes/1125447/16 "2021-02-26T22:47:57Z")

</div>

I get This error in the pdf window. I really dont get it. Because i get the URL from the api with the riht token etc. The api block works fine for everything else so it is NOT a demo link??

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/6/56be249521d694794c6fd59dd5427e94a41a03b0.jpeg)

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [February 27, 2021, 12:04am UTC](https://community.thunkable.com/t/need-help-to-download-af-pdf-that-is-a-stream-of-raw-bytes/1125447/17 "2021-02-27T00:04:09Z")

</div>

> [@funhall](#):
>
> hi. Do I have to have the Image also. Does it have a meaning that it is there?

No, that was just something I decided to test.

> [@funhall](#):
>
> The is crashing when I put the URL into the pdf reader.  
> I have the right URL in the tes\_input 4 field.

I’m sorry, I don’t know much about that. I had never used the PDF reader before today. Are you able to open the url that you get from the JSON and view the PDF outside of Thunkable? The blocks you have are **very** complicated so I would first make sure the PDF reader works with the basic url. Then try all of those list, etc. blocks.

And yes, you can store the url you get in a variable or list and use it like any other text.

---

<div class="post-metadata">

### Author: ![funhall](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/funhall/32/92145_2.png) [@funhall](https://community.thunkable.com/u/funhall)
#### Post date: [March 11, 2021, 7:17pm UTC](https://community.thunkable.com/t/need-help-to-download-af-pdf-that-is-a-stream-of-raw-bytes/1125447/18 "2021-03-11T19:17:40Z")

</div>

Hi again and thatnks for helping me out.  
I now tryed to get the test PDF as you did with succes.  
But these blocks is saying that the Booked invoice 3 was not found etc.  
Will you please try this again if you still have the prject to se if it works from your side please.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/f/cff79e7fcc072b0f5e4f76d07624eec4b52df7e2.png)

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [March 11, 2021, 7:40pm UTC](https://community.thunkable.com/t/need-help-to-download-af-pdf-that-is-a-stream-of-raw-bytes/1125447/19 "2021-03-11T19:40:42Z")

</div>

I don’t see those in the link I have from you. Maybe you can resend the link?

---

<div class="post-metadata">

### Author: ![funhall](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/funhall/32/92145_2.png) [@funhall](https://community.thunkable.com/u/funhall)
#### Post date: [March 11, 2021, 7:42pm UTC](https://community.thunkable.com/t/need-help-to-download-af-pdf-that-is-a-stream-of-raw-bytes/1125447/20 "2021-03-11T19:42:34Z")

</div>

Sure.  
This is the project you shared with me then  
[https://x.thunkable.com/copy/1363472ebf257a2c65bedb9f25436965](https://x.thunkable.com/copy/1363472ebf257a2c65bedb9f25436965)

[Next page](https://community.thunkable.com/t/need-help-to-download-af-pdf-that-is-a-stream-of-raw-bytes/1125447.md?page=2)
