How to pass / in the URL - wso2

I am using API Manager 2.0 to expose underlying DSS resources.
How can I pass / as part of the path parameter value.
Example: I need to access a REST resource person with date of birth as 26/01/2017 like this <endpoint>/person/26/01/2017
I have tried using %2F as well instead of / like <endpoint>/person/26%2F01%F2017. In this case it takes whole '26%2F01%F2017' as a string and passes on to next level which will not match with any date and returns no records.
This is with API Manager only. DSS is allowing me to access with / without any encoding.
Thanks

Related

Google CDF: Can we set the value of a column as a runtime argument?

I am getting a value returned by hitting a HTTP endpoint which I am storing in a column. Now a want to trigger another Http Endpoint with the value in the column. But the HTTP endpoint takes hardcoded values or macros only. So I want to know if I can set a run-time argrument based on the column value
Please suggest How I can do this.
There are few ways of setting runtime arguments:
Using Argument Setter Plugin - type of Action plugin that allows one to create reusable pipelines by dynamically substituting the configurations that can be served by an HTTP Server.
Specifying runtime arguments as a JSON map in the request body, when starting an program.
CDAP Preferences HTTP RESTful API.
I recommend you check the official documentation for Datafusion, where you can find a way of setting variables/macros using the GCS bucket.
Additionally, have a look at the following thread on SO. It describes the method with specifying runtime arguments as a JSON map in the request body.

Is it possible to request Instagram metrics with different periods in a single API call?

I would like to request the following Instagram Insights metrics using a single graph API call:
follower_count
audience_gender_age
The problem I am facing is that follower_count requires a period parameter 'day' and audience_gender_age a period parameter 'lifetime'. I have tried to merge them in a single API call, but this is not supported by Facebook:
/XXXXXX/?fields=insights.metric(follower_count).period(day),insights.metric(audience_gender_age).period(lifetime)
I there a proper way to request these metrics using different periods in a single API call?
If you need to request data from the same field twice in one query, that can be done using the .as(name) aliasing syntax, https://developers.facebook.com/docs/graph-api/aliasing-fields
Quote docs,
For example, you can retrieve an image in two sizes and alias the returned object fields as picture_small and picture_larger:
me?fields=id,name,picture.width(100).height(100).as(picture_small),
picture.width(720).height(720).as(picture_large)

Akamai Media Services Live Api: limit results from stream query

I am trying to get a list of our streams from Akamai's Media Services API v1; however, I'm only getting a 504 Gateway Timeout. I believe this is due to the amount of streams being queried for, as I can get a single stream when I give the ID for the GET stream/{streamId} endpoint.
I am using the edgegrid node module and have tried adding query parameters such as limit, pageSize/page-size, and stream-name/streamName to limit my results to no avail.
Is there a way to limit the results in a query for this API?
edit:
We are using v1 of the API
If you're using v2 of the API, it should automatically return the results paged. The API endpoint /config-media-live/v2/msl-origin/streams includes the ability to specify query string parameters page and pageSize. page is an integer that tells the API which page number to return. pageSize is also an integer referring to the number of entries the page should contain.
Example: /config-media-live/v2/msl-origin/streams?page=2&pageSize=10&sortKey=createdDate&sortOrder=ASC

Accessing raw url using AWS API Gateway

Is it possible to access the raw url using AWS API Gateway (and Lambda)?
Alternatively, is it possible to access the original, undecoded query string paramters?
We are integrating against a third party service, that calls our API and encodes the query string params from Windows-1252. (E.g. the finnish letter Ä is encoded as %C4 instead of %C3%84). API Gateway seems to automatically decode the query string parameters and assume UTF-8, which means, that Ä (and Ö and Å) result in \ufffd.
For reference: https://www.w3schools.com/tags/ref_urlencode.asp
Damn, it really doesn't look possible...
I started off writing how you can use Lambda Proxy Integration with event.queryStringParameters, but that parses the data into a key-value object.
Then I went down the road of Mapping Templates in API Gateway, but again there doesn't seem to be any property that shows the whole querystring.
As much as I didn't want it to be true, I can only conclude that it is not possible...
I think your best option is to encode the parameter as base64 on the client, then decode in the Lambda function using Object.keys(event.queryStringParameters)[0].

Azure Storage Copy Blob Console App - 403 Forbidden Error

Using Microsoft.WindowsAzure.Storage 2.1.0.3
Attemping to write a conosle app to move documents from one Azure Storage account to another account. The app lists all the containers using sourceClient.ListContainers(), loops through all containers in a foreach block getting a Shared Access Token for each, and then fires a StartCopyFromBlob request for each blob. The destination blob has the same naming structure, but is in a different account (e.g. sourceAzureUrl/testContainer/filename.ext -> destAzureUrl/testContainer/filename.ext).
Most of the files (98%) copy just fine, but when certain requests are sent, it returns with this exception: "The remote server returned an error: (403) Forbidden." When the CloudBlockBlob reference to the destination blob is created, the URL does not seem to be properly URL escaped which results in the exception. However, when this code is run inside of an MVC controller, the request is somehow properly URL escaped and the request is completed without error. The copied blob contains the unescaped name as well.
It appears that the reason is the blob/filename contains a "[" and/or "]" character (e.g. Roger_Smith[1].doc). If the the filename is URL encoded beforehand, the request is completed without error, but the filename in Azure Storage is its URL escaped incarnation and not the original filename (Roger_Smith%255b1%255d.doc instead of Roger_Smith[1].doc).
Is there a way to properly URL escape the copy request and still have the result blob have the unescaped name?
Can you confirm you are running with .net 4.5? There is a uri escaping issue for the characters you mentioned (brackets) that was introduced in .net 4.5 that is incompatible with .net 4.0 (which is what the service is using to validate the response). As such it appears as if the message signature was incorrectly formed. We are working with the .net team on long term resolution for this. In the meantime you may consider running under .net 4.0 (with .net 4.5 installed to take advantage of GC improvements) or avoiding the bracket characters in the file name.