Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED]Setting path parameters in REST synonym

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED]Setting path parameters in REST synonym
 Login/Join
 
Member
posted
I need to set path parameters for a REST api call to select different data. The api accept path parameters not request parameters (/uri/value vs. /uri?parameter=value) Also in some cases there are multiple pages returned that i need to interate through, which is also set via the path so /uri/value/pageIndex. I've explored setting the create synonym command in the FEX but i cant get it to work right, nor do i know if thats the correct way. Any help would be appreciated.

This message has been edited. Last edited by: <Emily McAllister>,


8103
Server 2012
 
Posts: 11 | Location: Danbury CT | Registered: March 12, 2015Report This Post
Virtuoso
posted Hide Post
The way I've done it is to use a variable in the meta-data.

For example, I've got 3 urls
http://jsonplaceholder.typicode.com/posts/1
http://jsonplaceholder.typicode.com/posts/10
http://jsonplaceholder.typicode.com/posts?userId=1  


Base URL in REST adaptor
http://jsonplaceholder.typicode.com/posts  


Master
FILENAME=SAMPLE_JSON_REST, SUFFIX=REST    , MFD_PROFILE=common/sample_json_rest_obj, $
 VARIABLE NAME=&&OBJ,  DEFAULT='1', $
  SEGMENT=M6ILO, SEGTYPE=S0, $
    FIELDNAME=__RESPONSE, USAGE=TX80L, ACTUAL=TX, ACCESS_PROPERTY=(INTERNAL), $
  SEGMENT=RESPONSE, SEGTYPE=S0, SEGSUF=JSON    , PARENT=M6ILO, POSITION=__RESPONSE, $
    FIELDNAME=JSON_DUMMY_EL, ALIAS=JSON_DUMMY_EL, USAGE=A1, ACTUAL=A1, ACCESS_PROPERTY=(INTERNAL),
      PROPERTY=ELEMENT,  $
    FIELDNAME=USERID, ALIAS=userId, USAGE=P33, ACTUAL=A33,
      REFERENCE=JSON_DUMMY_EL, PROPERTY=ELEMENT,  $
    FIELDNAME=ID, ALIAS=id, USAGE=P33, ACTUAL=A33,
      REFERENCE=JSON_DUMMY_EL, PROPERTY=ELEMENT,  $
    FIELDNAME=TITLE, ALIAS=title, USAGE=A74, ACTUAL=A74,
      REFERENCE=JSON_DUMMY_EL, PROPERTY=ELEMENT,  $
    FIELDNAME=BODY, ALIAS=body, USAGE=A158, ACTUAL=A158,
      REFERENCE=JSON_DUMMY_EL, PROPERTY=ELEMENT,  $
  


Acx
SEGNAME=M6ILO, 
  CONNECTION=SAMPLE, 
  OBJECT=&&OBJ, 
  SERVICETYPE=REST, 
  HTTPMETHOD=GET, 
  RESTRESPONSE=JSON, $  


MFD Profile (that you don't need if you set the value of &&OBJ before you run report):
-*-SET &&OBJ=10;
-SET &&OBJ='?userId=1';  


Just set the &&OBJ to the extended value that you require.


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
 
Posts: 1102 | Location: Toronto, Ontario | Registered: May 26, 2004Report This Post
Member
posted Hide Post
Works like a charm! Thanks.


8103
Server 2012
 
Posts: 11 | Location: Danbury CT | Registered: March 12, 2015Report This Post
Member
posted Hide Post
Actually one other question, Have you ever dealt with calls that give the results back in pages. If so, how do you iterate through the pages to get all the results. In my instance it will tell me the total number of pages and total records, which i could use to create a loop but im thinking there might be a better way?


8103
Server 2012
 
Posts: 11 | Location: Danbury CT | Registered: March 12, 2015Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED]Setting path parameters in REST synonym

Copyright © 1996-2020 Information Builders