• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: Pre-formatted HTML box losing format when retrieved from API

Resolved: Pre-formatted HTML box losing format when retrieved from API

0
By Isaac Tonny on 17/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

I am implementing a recruitement system (Lever) for a client of ours. One of its responsibilities is to list all of the available jobs opportunities inside the client’s website.
Based on their API documentation, inside the corresponding PHP file, I wrote the code to retrieve a list of all job listings and then use json_decode to parse them, before accessing each field seperately. For example, if I want to retrieve the job title for a single job opportunity, I use $jr['data'][$x]['text'] inside a for loop, where $jr stands for the decoded response and $x stands for the current for loop item.
With all that being said, Lever provides a description box when you create a job listing, which allows for simple html formatting and styling (bold, underline, ul, etc.). The problem is, in the process of retrieving and decoding the data inside the actual website, the html formatting is gone, meaning for example if the job listing contains a list with the job’s requirements, I am not able to see it as a list, rather just joined text. Same goes for any bold or underline formatting.
Any ideas?
EDIT: Here’s the code
For the GET Request:
For retrieving the job data (sample):

Answer:

If you check the documentation, https://hire.lever.co/developer/documentation#retrieve-a-single-posting, it becomes apparent real quick from the example given there, that they return a field description, which has any HTML stripped out – but that there is also a field descriptionHtml:

If you have better answer, please add a comment about this, thank you!

api html json php request
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: TypeScript does not recognize properties when instantiating interface array

27/03/2023

Resolved: How to make statement case insensitive when uploading a dta file with specified columns?

27/03/2023

Resolved: Sort dataframe columns value by close it to another column

27/03/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.