AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

Use external variables (export values) in Chatscript
 
 
  [ # 16 ]

Try this:

$_x = “[{.....}]”
$_y = ^jsonparse($_x)
...

 

 
  [ # 17 ]

Thanks a bunch for your consistent help. The web json is working for me now just like you told me to fetch previously. Here is a snippet in case it could help someone else.

outputmacro: ^testing()
  
$user_agent = ^"User-Agent: Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)"
  
$url = ^join(https://api.github.com/users/test/repos)  # limit 1000 requests/day
  
$jsonid2 = ^jsonopen(GET $url "" $user_agent)
  
$answer = ^jsonpath("[0].owner.id" $jsonid2)
  if (!
$answer
 there is no result 
  } 
  
else 
  

    the result is $answer 
  } 

Thanks.

 

 < 1 2
2 of 2
 
  login or register to react