Unable to fetch pdf content from API

Thanks @felix-appsmith for checking the app.

I am working with resumes of these format - pdf, docx, doc, txt

When I upload it in Appsmith or Postman, It should read in bytes and share that payload to API.

Check the screenshot above in this thread where I posted python “requests” way of calling API in postman.

Let me know if you still have questions.

I have a question, is this attached image the expected response from the API?

Moreover, does the CV sent to the API need to have a specific format?

Could you please share a sample CV with me?

image

Hi @felix-appsmith ,

I just shared sample resume on email.
Yes, the output will be the same as seen in the image.
I need to make some changes to the API to load in the table widget, but first, appsmith API should send the file data correctly.

Can you elaborate on what you mean by format here?
I want it to work the same as we do it via Postman.

Thanks for this, let me check.

@hitz02 To which email did you send the test CV?

@felix-appsmith I emailed it to support@appsmith.com

hi @felix-appsmith, did you receive resume from my email? Any update?

hi @felix-appsmith @Olawale, any update here?

Hello! Sorry for the delay. It seems that the last message from Felix didn’t get sent:

It seems like you made some changes to your API as I’m getting this error when trying to load the data.

Do you know what could be causing it or what your API is expecting to receive?

Also, I would like to recommend that you try processing the data from your API using a base64 file instead of plain text.

Thanks for the response @Amelia

I made no changes to the API, check the screenshot attached, I am able to get response using Postman

Hello @hitz02 , it seems like this is now working properly, and you are receiving the expected response from the API through Appsmith.

I changed the data type of the file picker from text/plain to text/binary, and this allowed the data to be properly retrieved. Additionally, I wrote a JavaScript object that correctly embeds the data in your widget. Please review the application and let us know if it is now behaving as expected. Thank you very much for your patience.

Thanks @felix-appsmith for putting efforts on my request.

I tried from my end and I got this attached error.
I believe it is related to Table widget and the datatype.

Furthermore, I was not able to see what the API returned, is there a way to look at logs and see what was returned from the API?

Hi @hitz02 , I left a JavaScript function that formats the API result to display it properly on the table widget. After executing the query, run that JavaScript object and you will see the data. You can modify the JavaScript object to better fit your needs.

Hi @felix-appsmith, are you suggesting to stack 2 JS runs one after the other for the upload onclick event?
If yes, how can I do that in appsmith?

Like this? ----> {{upload.run(), populate_table.run()}}

Hello, I created another JavaScript function named Executing where I execute your API of the JavaScript object that formats the data for the table widget.

It gives me error, did you try once?

Hi, I tried once and it gave me an error. The problem was that I tried to upload the same CV with the same name. I only changed the name of the CV file, and it worked.

Hi @felix-appsmith, I tried with other PDF files, none of them work.
Can you tell me which file worked?
And most importantly, how do I debug and check logs to see what is wrong?

Hi @hitz02, @felix-appsmith is currently out of the office. We might not be able to share the files you requested.
By logs, you mean application logs, right? If so, you check them here:

Hi @Olawale , I want to debug and understand what is not working? The JS for upload API or the JS for table widget.

After the upload processing is failed, when I go to the logs, I can see nothing about what was parsed or what actually failed.