Hitachi Vantara Pentaho Community Forums
Results 1 to 6 of 6

Thread: Pentaho and Zendesk (JSON API database)

  1. #1
    Join Date
    Sep 2014
    Posts
    175

    Default Pentaho and Zendesk (JSON API database)

    Hello there-

    Has anyone ever tried working with Zendesk much?

    It's back-end API is a JSON database. I'm getting stuck on how to get through basic authentication while using the Pentaho system (JSON input, I guess, would be the first step).


    Their own documentation seems to prefer curl commands instead of direct URL calls .... again, how would this work in Pentaho?

    They recommend the following curl command:

    curl -u EMAILADDRESS@YAHOO.COM/token:YOUR_TOKEN https://support.MYCOMPANYNAME.com/api/v2/users/me.json

    Note that instead of a simple usernameassword, there appears to be a /token in between the two things. I'm pretty sure i MIGHT be able to use usernameassword as well, if their documentation is understood.

    Could I execute such curl commands directly in Pentaho somehow? Or do I need to convert them to URLs?

    This all seems woefully complicated --- so much easier before when I could just connect to a database or pass credentials in headers like www.lalala.com/?user=USER&pass=PASSWORD.

    Any help much appreciated.

  2. #2
    Join Date
    Sep 2014
    Posts
    175

    Default

    Actually I figured it out. I can enter https://{my-username}%2Ftoken:{mytoken}@mysubdomain@zendesk.com/api/v2/blahblahblah.json

    the %2F escapes a forward slash.

    Ugh, nothing is ever simple with this zendesk application.

    I'll see if this URL input works with the JSON input in Pentaho. I know a wide variety of URLs are accepted in the XML input. Hopefully the JSON isn't much different.

  3. #3
    Join Date
    Sep 2014
    Posts
    175

    Default

    Ah --- even though I can get the proper URL/ headers/ authentication / whatever format and get it to work in the browser, or POSTman --- for the life of me, it keeps saying "invalid URI" in Pentaho.

    How the hell do I get the JSON input --- or anything that will accept JSON --- or any text format ---- to retrieve URLs that require Basic Authentication ------- either using username/ password, the Header 'Authorization' followed by Basic and Base46 code, or the URI I discovered .... these all work in other programs, but not Pentaho.

    I see Pentaho has HTTP functions and RESTful services under "Lookup" --- however those aren't row inputs. So I'm still perplexed. There is no way to get into a JSON database that requires Basic Authentication with Pentaho?

    I guess my only alternative is some sort of automation that regularly downloads these JSON files from online --- though that's a huge pain.

  4. #4
    Join Date
    Aug 2011
    Posts
    236

    Default

    Hi cool_runnings,

    I use curl for other API - I am thinking your request would look like :-

    curl -u EMAILADDRESS@YAHOO.COM/token:YOUR_TOKEN https://support.mycompanyname.com/api/v2/users/me.json -H "Content-Type: text/json; charset=UTF-8 ; Accept: application/json" -d SOAPAction: query > output.json

    The API doc says you have to include "Content-Type: text/json; charset=UTF-8 ; Accept: application/json" in the request

    I would look at the docs a bit more - https://developer.zendesk.com/rest_a...uction#the-api

    Just trying to help..
    PDI 8.0.0
    MySQL - 5.6.27
    Redshift - 1.0.1485
    PostgreSQL 8.0.2
    OS - Ubuntu 10.04.2

  5. #5
    Join Date
    Sep 2014
    Posts
    175

    Default

    Thanks tnewman.

    I think I'm unsure which of the inputs/ steps to use in a transformation to access this JSON data. The JSON input doesn't seem to work, so what input would help me make curl requests as you mentioned? Thanks.

  6. #6
    Join Date
    Aug 2011
    Posts
    236

    Default

    Hi Cool-runnings,

    You should setup the curl command in a bash script (you can setup the inputs as parameters $1,$2 etc) and then use the scripting shell component (in a job) to call the scripts (passing parameters as needed).

    HTH.
    PDI 8.0.0
    MySQL - 5.6.27
    Redshift - 1.0.1485
    PostgreSQL 8.0.2
    OS - Ubuntu 10.04.2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.