So I'm quite new to IIB and Extended SQL but what I want to do should be straight forward. I have a REST application which has a resource that is attached to a subflow. What I want to do is to get the input value passed to the service and use it to call a remote web service using the HTTP request node as shown below
SET OutputLocalEnvironment.Destination.HTTP.RequestLine.Method = 'POST';
SET OutputLocalEnvironment.Destination.HTTP.RequestURL = 'http://localhost:8002/MyService';
SET OutputLocalEnvironment.Destination.HTTP.QueryString.RemoteParam= InputLocalEnvironment.REST.Input.Parameters.myValue;
What is happening is, when I call the REST method and pass the value as a GET, I'm able to access the value. However, when I pass the parameter value using POST, I'm unable to access the value. My current flow is as follows:
Input > Compute > HTTPRequest > Compute > Output
I have searched on Google and applied all recommendations (e.g. setting compute node to LocalEnvironment) but nothing seems to work.
Well, we need more information in order to solve your problem but I guess you have problem in your HTTP request node
Go to HTTP request then in properties go to HTTP setting and change HTTP method to the method that you are using ( get or post )
and if you want to see if you are fetching data from right property just lunch debugger and put breakepoint in before and after of your nodes, then you can see what data you are receiving in each level and you can call the proper property.
ps. don't forget to deploy your project again in order to see new
changes
I hope that works for you
After further research, I found that IIB does not automatically parse content submitted as application/x-www-form-urlencoded. I inserted a trace node and realised that the parameters are instead submitted as a BLOB. All I had to do was read the blob, cast it to a string then use a Split function or a message model to get the individual parameters. Thanks for the pointers
With Reference to https://api.coinigy.com/api/v2/docs/, trying to call
/private/exchanges/{exchCode}/markets/{baseCurrCode}/{quoteCurrCode}/trades/history
This api has following parameters:
exchCode : URL Parameter
baseCurrCode : URL Parameter
quoteCurrCode : URL Parameter
StartDate : DateTime / Query Parameter
EndDate : DateTime / Query Parameter
Based on these details following is final url generated:
https://api.coinigy.com/api/v2/private/exchanges/BITS/markets/BTC/USD/Trades/history?StartDate=2008-8-01T12:30:00&EndDate=2018-9-20T12:30:00
and End point generated for signature is
/api/v2/private/exchanges/BITS/markets/BTC/USD/Trades/history?StartDate=2008-8-01T12:30:00&EndDate=2018-9-20T12:30:00
But, this is giving always Unauthorized Reply.
What could be reason for this ?
Remove ?StartDate=2008-8-01T12:30:00&EndDate=2018-9-20T12:30:00 from your generated endpoint included in the X-API-SIGN header generation
There are two reasons I can think of that this might be happening off the top of my head:
You are not using a key with sufficient access (this endpoint requires a CRYPTOFEED subscription). If you're not sure, check with support or see if the api key management interface offers an indicator of what type of permissions it has
As #Ahmed said, the signature should not include parameters in it, just the endpoint itself. Also, for the times, put a 'Z' at the end to specify UTC time
I want to get all price levels for crypto order book data from the Quoine Exchange. With this https-request I can only get the default 20 price levels:
https://api.quoine.com/products/1/price_levels/
Somehow, I need to include the 'full' parameter in my request and set it to 1:
https://developers.quoine.com/#get-a-product
Where do I have to insert this parameter in my request?
Any help appreciated! Thanks!
To add a parameter to a GET request you can use ? and &.
For example:
https://api.quoine.com/products/1/price_levels?full=1
And if you need to do more than one parameter
https://api.quoine.com/products/1/price_levels?full=1&moreparam=1
How could one open a phone call entity form so that direction is Incoming and that in "From" field there's a contact. I know already who is calling and I have the GUID. I know it's always contact. And I know that phone call is always incoming.
I have to use window.open function and pass those values in url. This site (https://msdn.microsoft.com/en-us/library/gg334375.aspx) does explain how to provide values for option sets and lookups, but in phone call "From" field is not a simple lookup but party list. And direction is not an option set but a Two options (if that makes any difference).
I have simply tried this
var extraqs = "directioncode=1&from=" + contactid;
window.open("https://myserver.crm4.dynamics.com/main.aspx?etn=phonecall&pagetype=entityrecord&extraqs=" + encodeURIComponent(extraqs));
but I can't get it work. I have tried to fiddle with those values back and forward and sometimes I get no error but it doesn't work either. Sometimes I get System.Web.HttpUnhandledException. I know it's probably because the format is off.
Another option I was thinkin that I could probably pass those values in url to the form and then create a function to form onLoad event where I could more easily set those field. But it sounds a workaround to me.
But my question is can I, and if how, set up those two fields?
A party list can not be set like a simple lookup.
Check out this blog post, it may guide you in setting party list
http://scaleablesolutions.com/open-new-activity-form-with-regarding-and-partylist-field-prefilled/
Why are there GET and POST requests in AJAX as it does not affect page URL anyway? What difference does it make by passing sensitive data over GET in AJAX as the data is not getting reflected to page URL?
You should use the proper HTTP verb according to what you require from your web service.
When dealing with a Collection URI like: http://example.com/resources/
GET: List the members of the collection, complete with their member URIs for further navigation. For example, list all the cars for sale.
PUT: Meaning defined as "replace the entire collection with another collection".
POST: Create a new entry in the collection where the ID is assigned automatically by the collection. The ID created is usually included as part of the data returned by this operation.
DELETE: Meaning defined as "delete the entire collection".
When dealing with a Member URI like: http://example.com/resources/7HOU57Y
GET: Retrieve a representation of the addressed member of the collection expressed in an appropriate MIME type.
PUT: Update the addressed member of the collection or create it with the specified ID.
POST: Treats the addressed member as a collection in its own right and creates a new subordinate of it.
DELETE: Delete the addressed member of the collection.
Source: Wikipedia
Well, as for GET, you still have the url length limitation. Other than that, it is quite conceivable that the server treats POST and GET requests differently; thus the need to be able to specify what request you're doing.
Another difference between GET and POST is the way caching is handled in browsers. POST response is never cached. GET may or may not be cached based on the caching rules specified in your response headers.
Two primary reasons for having them:
GET requests have some pretty restrictive limitations on size; POST are typically capable of containing much more information.
The backend may be expecting GET or POST, depending on how it's designed. We need the flexibility of doing a GET if the backend expects one, or a POST if that's what it's expecting.
It's simply down to respecting the rules of the http protocol.
Get - calls must be idempotent. This means that if you call it multiple times you will get the same result. It is not intended to change the underlying data. You might use this for a search box etc.
Post - calls are NOT idempotent. It is allowed to make a change to the underlying data, so might be used in a create method. If you call it multiple times you will create multiple entries.
You normally send parameters to the AJAX script, it returns data based on these parameters. It works just like a form that has method="get" or method="post". When using the GET method, the parameters are passed in the query string. When using POST method, the parameters are sent in the post body.
Generally, if your parameters have very few characters and do not contain sensitive information then you send them via GET method. Sensitive data (e.g. password) or long text (e.g. an 8000 character long bio of a person) are better sent via POST method.
Thanks..
I mainly use the GET method with Ajax and I haven't got any problems until now except the following:
Internet Explorer (unlike Firefox and Google Chrome) cache GET calling if using the same GET values.
So, using some interval with Ajax GET can show the same results unless you change URL with irrelevant random number usage for each Ajax GET.
Others have covered the main points (context/idempotency, and size), but i'll add another: encryption. If you are using SSL and want to encrypt your input args, you need to use POST.
When we use the GET method in Ajax, only the content of the value of the field is sent, not the format in which the content is. For example, content in the text area is just added in the URL in case of the GET method (without a new line character). That is not the case in the POST method.