Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: Shell Script, cURL, = no data returned

  1. #1
    Join Date
    Oct 2017
    Posts
    3

    Default Shell Script, cURL, = no data returned

    Hello All,

    I am trying to make an API call using the Shell Script and cURL. The shell script is as follows: curl --user user:word -H "Content-Type: application/json" "https://aUniverseFar.FarAway.com/api/xm/1/people/?propertyName=Department&propertyValue=Info0Tech" seems to work but "data":[] is empty. If I paste this command into the command line I get the appropriate JSON data back.

    How can I begin to trouble shoot this since technically I'm not getting an error?

    TIA
    Last edited by bobV; 10-12-2017 at 12:02 PM.

  2. #2
    Join Date
    Aug 2011
    Posts
    228

    Default

    Hi bobv,

    Do you have the -o option or redirect '>' to capture the output?
    After the curl command, can you display the return code ($? in bash)

    Maybe you need other options for curl?

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

  3. #3
    Join Date
    Oct 2017
    Posts
    3

    Default

    Thanks for the reply tnewman the results of adding the -o option are {"count":0,"total":0,"data":[],"links":{"self":"/api/xm/1/people?propertyName=Department&propertyValue=Info0Tech&offset=0&limit=100"}} which is no more information than I had before as this is reported in the logging tab. I am loading wire shark to see if I can get into the transaction flow between requester script and target API.


    Thank you
    Bob

    Win 10 64
    Pentaho CE 7.1
    cURL 7.56.0

  4. #4
    Join Date
    Oct 2017
    Posts
    3

    Default

    Running the cURL command with the --trace-ascii option set shows this at line 170 of the pentaho shell script output:
    <= Recv data, 134 bytes (0x86)

    Running the cURL command with the --trace-ascii option set shows this at line 170 of the windows command shell output:
    <= Recv data, 14019 bytes (0x36c3)

    This indicates to me that for some reason the pentaho shell script is failing at or being truncated ate the receive data step.

    any thoughts?

  5. #5
    Join Date
    Apr 2008
    Posts
    4,459

    Default

    Silly question, but why are you using cURL to do this when you can hit the URL in a JSON input step?

    https://user:word@aUniverseFar.FarAway.com/api/xm/1/people/?propertyName=Department&propertyValue=Info0Tech

Tags for this Thread

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 - 2017 Pentaho Corporation. All Rights Reserved.