Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Daft API key?

  • 26-11-2019 2:50pm
    #1
    Registered Users, Registered Users 2 Posts: 3,061 ✭✭✭


    Hi All,

    I am, trying to embed Daft.ie into a html5 website.

    I have the API key and this guide below but I'm a little lost!
    https://api.daft.ie/gettingstarted/

    Any ideas of trhe code I ad into my <body> tag to enable this to work?

    Daft.ie have said they cannot help with coding...

    Thanks!


Comments

  • Registered Users, Registered Users 2 Posts: 68,317 ✭✭✭✭seamus


    You can't embed this kind of content in HTML alone.

    You need another kind of language to make the call to the API, return the data and then output it into your document.

    You can use javascript. There are lots of javascript libraries for this. It's not entirely recommended because it all runs client-side - on your visitor's browser. This means that their computer will use your API key to retrieve the data.

    So for these purposes there isn't a lot they could do with your Daft developer key. At worst somebody abuses it to download data and Daft disable your API key. But in general embedding API keys in client side code is bad practice outside of a few scenarios.

    The API reference above gives a PHP example. PHP is a good entry point for people who are familiar with HTML but not with application programming. Have a look on w3schools for a PHP tutorial and then try to apply the example given by Daft for retrieving and displaying data.


  • Registered Users, Registered Users 2 Posts: 3,061 ✭✭✭sticker


    seamus wrote: »
    You can't embed this kind of content in HTML alone.

    You need another kind of language to make the call to the API, return the data and then output it into your document.

    You can use javascript. There are lots of javascript libraries for this. It's not entirely recommended because it all runs client-side - on your visitor's browser. This means that their computer will use your API key to retrieve the data.

    So for these purposes there isn't a lot they could do with your Daft developer key. At worst somebody abuses it to download data and Daft disable your API key. But in general embedding API keys in client side code is bad practice outside of a few scenarios.

    The API reference above gives a PHP example. PHP is a good entry point for people who are familiar with HTML but not with application programming. Have a look on w3schools for a PHP tutorial and then try to apply the example given by Daft for retrieving and displaying data.

    Thanks - But I'm a little lost! I didn't plan on learning PHP!

    Is there no simple code I can use in this instance? I'd be happy to pay someone for their time in settling this up!


  • Registered Users, Registered Users 2 Posts: 24,558 ✭✭✭✭lawred2


    sticker wrote: »
    Thanks - But I'm a little lost! I didn't plan on learning PHP!

    Is there no simple code I can use in this instance? I'd be happy to pay someone for their time in settling this up!

    setting what up exactly?


  • Registered Users, Registered Users 2 Posts: 3,061 ✭✭✭sticker


    lawred2 wrote: »
    setting what up exactly?

    The facility for this API to work on my html5 coded website....


  • Closed Accounts Posts: 9,046 ✭✭✭Berserker


    sticker wrote: »
    The facility for this API to work on my html5 coded website....

    Just had a quick look at the daft API. What data are you looking to retrieve from it? Tried to post a code block with a sample API call, in a very basic HTML page but boards doesn't allow it. StackOverFlow has some examples on how to do this. You are going to have to write code to do anything with this API on your site.


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 3,061 ✭✭✭sticker


    Berserker wrote: »
    Just had a quick look at the daft API. What data are you looking to retrieve from the API? Tried to post a code block with a sample API call in a very basic HTML page but boards doesn't allow it. StackOverFlow has some examples on how to do this. You are going to have to write code to do anything with this API on your site.

    Many Thanks for that - I think you need the client API key? Its for a friend's business so I can't give it out unfortunately :(


  • Closed Accounts Posts: 9,046 ✭✭✭Berserker


    sticker wrote: »
    Many Thanks for that - I think you need the client API key? Its for a friend's business so I can't give it out unfortunately :(

    Only if I want to call the daft API. There are plenty of APIs out there that don't require a key.


  • Registered Users, Registered Users 2 Posts: 3,061 ✭✭✭sticker


    Berserker wrote: »
    Only if I want to call the daft API. There are plenty of APIs out there that don't require a key.

    I've been told I need to user the client API key so his properties show up in his website...


  • Registered Users, Registered Users 2 Posts: 10,902 ✭✭✭✭28064212


    If you can't make the API key public (which as seamus said, you should never do anyway), then you absolutely have to use a server-side language (PHP, Java, Python, C#) to do anything. That's a hard requirement. If your friend is running a business, he should hire a professional to do it

    Boardsie Enhancement Suite - a browser extension to make using Boards on desktop a better experience (includes full-width display, keyboard shortcuts, dark mode, and more). Now available through your browser's extension store.

    Firefox: https://addons.mozilla.org/addon/boardsie-enhancement-suite/

    Chrome/Edge/Opera: https://chromewebstore.google.com/detail/boardsie-enhancement-suit/bbgnmnfagihoohjkofdnofcfmkpdmmce



  • Registered Users, Registered Users 2 Posts: 3,061 ✭✭✭sticker


    28064212 wrote: »
    If you can't make the API key public (which as seamus said, you should never do anyway), then you absolutely have to use a server-side language (PHP, Java, Python, C#) to do anything. That's a hard requirement. If your friend is running a business, he should hire a professional to do it

    ok thanks


  • Advertisement
  • Closed Accounts Posts: 9,046 ✭✭✭Berserker


    sticker wrote: »
    I've been told I need to user the client API key so his properties show up in his website...

    The api key grants you access to the API. In agreement with sticker and the other posters, might be time to pull in some professional help on this. Best of luck with it.


  • Registered Users, Registered Users 2 Posts: 3,061 ✭✭✭sticker


    Berserker wrote: »
    The api key grants you access to the API. In agreement with sticker and the other posters, might be time to pull in some professional help on this. Best of luck with it.

    Any recommendations on someone I could ask?

    Thanks..


  • Closed Accounts Posts: 1,698 ✭✭✭kenmm


    You need to hire a software developer, discuss requirements etc. This isn't necessarily cheap (Or more realistically the cheaper it is the more dangerous it could be..)

    Depending on what you want you may get away with an ODesk/Upwork or the like.


  • Registered Users, Registered Users 2 Posts: 34,216 ✭✭✭✭listermint


    If your doing website design on the regular then it might be prudent to develop some basic PHP skills. API authentication is common place in any number of integrations you may require for clients sites.

    Put the effort in now it will pay off. This I'm sure won't be the last type of this request.


Advertisement