cancel
Showing results for 
Search instead for 
Did you mean: 

Consume External Rest API/Webservice Bydessing

former_member625744
Discoverer

Hello Experts,

I´m trying to consume this API https://www.banxico.org.mx/SieAPIRest/service/v1/series/SF43718/datos/oportuno?token=afb1ff06d28de69...

as you can see I only provide the series SF43718 and the Token, i follow some examplos of consumme a Rest API and the example where i get the Api from here:

https://www.banxico.org.mx/SieAPIRest/service/v1/doc/ejemplos

I create my external Rest webservice in SDK:

My Scenario:

And the arregement:

My question is where and what info i have to send, as you can see I´m trying to complete the link to get the contect but i´m not getting anything and a HTTP destination error too.

Here is my code:

import ABSL;
// Communication details
var ScenarioName = "Cambio_CS";
var ServiceName = "Cambio";
var HttpMethod = "GET";
var HttpResource = "datos/oportuno"; //URL – File Name"
// not required for this example
var ContentType = "jsonp";
var Body = "";
var HeaderParameter : collectionof NameAndValue; // Set URL Parameter


var URLParameter : collectionof NameAndValue;
var URLParameterEntry : NameAndValue;
URLParameterEntry.Name = "token";
URLParameterEntry.Value = "afb1ff06d28de692af5b679906c7d722454412908c4cb29687ac857786c95493";
URLParameter.Add(URLParameterEntry);


// Execute webservice call
var ws_result = WebServiceUtilities.ExecuteRESTService(ScenarioName, ServiceName, HttpMethod,
 HttpResource, URLParameter, HeaderParameter, ContentType, Body);
//Parse result of Web service and retrieve city name; you may have to adapt the logic to the Web service used
this.WeatherResult = ws_result.Content;

Hope you can help me.

Thank you for your time.

Regards.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member592782
Active Participant
0 Kudos

Hello Carlos,

To get this REST Service to work simply remove the HttpResource (leaving it blank) and pass the URL inside the WSID as far as the /oportuno collection.

Hope this helps,

Piotr.

former_member625744
Discoverer
0 Kudos

Hello Piotr,

Thank you for your answer, I tried removint the HttpResource as you mention but I´m still getting the next error "HTTP destination error" and the webservice returns only empty values, I tried creating a new external webservice and arregement but I get always the same result.

¿Could be the datatype in XML or JSON the reason im getting this error?

Regards.