Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

How to read data in Jason file using an API

SamSurya
8 - Asteroid

Hi Team,

 

I need to fetch some information from a Jason file using an API. Please advise How can I do that.

 

Rgds

8 REPLIES 8
echuong1
Alteryx Alumni (Retired)

To pull data using an API, use the download tool. Once you have the data downloaded in a JSON format, you can use the JSON parse tool to separate into fields, and then the cross-tab tool to put the fields horizontally. 

 

These links may be helpful:

https://community.alteryx.com/t5/Engine-Works/REST-API-In-5-Minutes-No-Coding/ba-p/8137

https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/Guide-to-Creating-Your-Own-Connecto...

https://community.alteryx.com/t5/Weekly-Challenge/Challenge-7-Download-Data-and-Parse-JSON/td-p/3673...

SamSurya
8 - Asteroid

Hi,

 

I have refer the links provided. so my API is Jason based and no Key is required so in the Text Input File, I have created 2 fields : 1. URL 2. Filename : ABC.txt

 

now have connected to Download tool

where in the URL Field I've selected URL & tried with below 2 options:

1Selected Output as String  : then I'm getting below in Download Datar "

 <!-- SiteMinder Encoding=ISO-8859-1; -->

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Internal Single Sign-on Server</title>
<p hidden>XXX WebSSO Login</p>
<meta http-equiv="Content-Type" content="text/html; char... HTTP/1.1 302 Found
Date: Fri, 21 Aug 2020 14:17:01 GMT
Server: Apache
Cache-Control: no-store
Location: https://post.smlogin.ibb.XXX.net/SmMakeCookie.ccc?GPSESSION=QUERY&PERSIST=0&TARGET=-SM-HTTPS%3a%2f%2......

 

2. If I output data to file  : choose name from Field : Filename 

 

I get Error :  JSON Parse (3) Error message: Invalid value. at character position: 0

 

 

Please advise

 

 

 

ImadZidan
12 - Quasar

Hello @SamSurya ,

 

Is it possible to see the workflow.

 

SamSurya
8 - Asteroid

sorry... that's my challenge but i can share this much:

SamSurya_0-1598027375198.pngSamSurya_1-1598027416709.png

 

SamSurya_2-1598027457010.png

 

beckyconning
5 - Atom

Hey! Check out this Alteryx partner solution that makes this simple : )

 

Simply paste your API details in and it'll handle all types of pagination and authentication, even OAuth2.

 

Screenshot 2020-08-21 at 18.35.03.png

 

Then it shows you all the fields available in the JSON data and you pick the ones you want. It works even if the data is very nested.

 

 

Screenshot 2020-08-21 at 18.35.30.png

 

 

Then you copy a link and paste it into a tool in Alteryx and your API data loads into Alteryx as a nice normal table.

 

Screenshot 2020-08-21 at 18.35.38.png

 

 

You can download the tool here https://gallery.alteryx.com/#!app/Precog---Easy-and-fast-JSON--MongoDB--Web-APIs-and-more/5d5bf6708a...

 

Screenshot 2020-08-21 at 18.35.46.png

  
Simply re-run your Alteryx workflow to refresh and get the latest data from your API.

 

SamSurya
8 - Asteroid

this is really good but I t seema I have a different issue because my problem still persists.

beckyconning
5 - Atom

I'm happy to help get you up and running, would you like to screen-share or perhaps you can provide additional details as to the problem you're experiencing? Is there a specific error message or something?

Thanks!

SamSurya
8 - Asteroid

Thanks, I can not share but please allow me a day time I will share my exact problem. 🙂

Labels