[prev in list] [next in list] [prev in thread] [next in thread]
List: esb-java-dev
Subject: Re: [Dev] [AM] Getting Bad Request as the response message when invoking Create API
From: Prakhash Sivakumar <prakhash () wso2 ! com>
Date: 2016-12-29 16:46:05
Message-ID: CAA24timTuiujDkYwFi2JRCfkZUtuAD-do04s0ZoH4u_HpjzTRg () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
It works after I changed it as thumbnailUri.
Thanks
On Thu, Dec 29, 2016 at 9:52 PM, Bhathiya Jayasekara <bhathiya@wso2.com>
wrote:
> Try "thumbnailUri" instead as mentioned in docs[1].
>
> [1] https://docs.wso2.com/display/AM200/apidocs/publisher/#!/operations#
> APICollection#apisPost
>
> Thanks,
> Bhathiya
>
> On Thu, Dec 29, 2016 at 9:40 PM, Prakhash Sivakumar <prakhash@wso2.com>
> wrote:
>
>> Hi all,
>>
>> I'm trying to invoke the APIM *Create API* as below with the payload I
>> have added below.
>>
>> curl -H "Authorization: Bearer 717e570e-5ccc-3c4a-9906-6bd81e94a7db" -H
>> "Content-Type:application/json" -X POST -d @data.json
>> http://127.0.0.1:9763/api/am/publisher/v0.10/apis
>>
>> I'm getting the response as below when doing this
>>
>> {"code":400,"message":"Bad Request","description":"Unrecognized property
>> 'thumbnailUrl'","moreInfo":"","error":[]}
>>
>> But when I remove the *thumbnailUrl* from the payload this works
>> perfectly.
>>
>> What might be the reason for the bad request response when I'm sending
>> the request with the thumbnailUrl?
>>
>> I'm following the example from the Lab kit in [1] and using the AM 2.0.
>>
>>
>> *Payload*
>> ========
>> {
>> "sequences":[
>>
>> ],
>> "tiers":[
>> "Bronze",
>> "Gold"
>> ],
>> "thumbnailUrl":null,
>> "visibility":"PUBLIC",
>> "visibleRoles":[
>>
>> ],
>> "visibleTenants":[
>>
>> ],
>> "cacheTimeout":300,
>> "endpointConfig":"{\"production_endpoints\":{\"url\":\"http
>> ://maps.google.com/maps/api/directions/\",\"config\":null},\"endpoint_type\":\"http
>> \"}",
>> "subscriptionAvailability":null,
>> "subscriptionAvailableTenants":[
>>
>> ],
>> "destinationStatsEnabled":"Disabled",
>> "apiDefinition":"{\"paths\":{\"\/*\":{\"get\":{\"x-auth-typ
>> e\":\"Application\",\"x-throttling-tier\":\"Unlimited\",\"
>> responses\":{\"200\":{\"description\":\"OK\"}}}}},\"x-wso2-
>> security\":{\"apim\":{\"x-wso2-scopes\":[]}},\"swagger\"
>> :\"2.0\",\"info\":{\"title\":\"GoogleDirectionsAPI\",\"description\":\"Calculates
>> directions between locations\",\"contact\":{\"email\":\"
>> ApiPublisher@pizzashack.com\",\"name\":\"ApiPublisher
>> \"},\"version\":\"Beta\"}}",
>> "responseCaching":"Disabled",
>> "isDefaultVersion":true,
>> "gatewayEnvironments":"Production and Sandbox",
>> "businessInformation":{
>> "technicalOwner":"ApiCreator",
>> "technicalOwnerEmail":"ApiCreator@pizzashack.com",
>> "businessOwner":"ApiPublisher",
>> "businessOwnerEmail":"ApiPublisher@pizzashack.com"
>> },
>> "transport":[
>> "http",
>> "https"
>> ],
>> "tags":[
>> "phone",
>> "multimedia",
>> "mobile"
>> ],
>> "provider":"admin",
>> "version":"Beta",
>> "description":"Calculates directions between locations",
>> "name":"GoogleDirectionsAPI",
>> "context":"/googledirections"
>> }
>>
>>
>> [1] http://wso2.com/training/api-manager-developer-fundament
>> als#request_training_enroll
>> --
>> Prakhash Sivakumar
>> Software Engineer | WSO2 Inc
>> Platform Security Team
>> Mobile : +94771510080 <077%20151%200080>
>> Blog : https://medium.com/@PrakhashS
>>
>> _______________________________________________
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> *Bhathiya Jayasekara*
> *Senior Software Engineer,*
> *WSO2 inc., http://wso2.com <http://wso2.com>*
>
> *Phone: +94715478185 <+94%2071%20547%208185>*
> *LinkedIn: http://www.linkedin.com/in/bhathiyaj
> <http://www.linkedin.com/in/bhathiyaj>*
> *Twitter: https://twitter.com/bhathiyax <https://twitter.com/bhathiyax>*
> *Blog: http://movingaheadblog.blogspot.com
> <http://movingaheadblog.blogspot.com/>*
>
--
Prakhash Sivakumar
Software Engineer | WSO2 Inc
Platform Security Team
Mobile : +94771510080
Blog : https://medium.com/@PrakhashS
[Attachment #5 (text/html)]
<div dir="ltr">It works after I changed it as \
thumbnailUri.<div><br></div><div>Thanks</div></div><div class="gmail_extra"><br><div \
class="gmail_quote">On Thu, Dec 29, 2016 at 9:52 PM, Bhathiya Jayasekara <span \
dir="ltr"><<a href="mailto:bhathiya@wso2.com" \
target="_blank">bhathiya@wso2.com</a>></span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div dir="ltr">Try "<span \
style="color:rgb(51,51,51);font-family:menlo,monaco,consolas,"courier \
new",monospace;font-size:12.6px;white-space:pre-wrap;background-color:rgb(232,232,232)">thumbnailUri</span>" \
instead as mentioned in docs[1].<div><br></div><div>[1] <a \
href="https://docs.wso2.com/display/AM200/apidocs/publisher/#!/operations%23APICollection%23apisPost" \
target="_blank">https://docs.wso2.com/<wbr>display/AM200/apidocs/<wbr>publisher/#!/ope \
rations#<wbr>APICollection#apisPost</a></div><div><br></div><div>Thanks,</div><div>Bhathiya</div></div><div \
class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Thu, Dec 29, \
2016 at 9:40 PM, Prakhash Sivakumar <span dir="ltr"><<a \
href="mailto:prakhash@wso2.com" target="_blank">prakhash@wso2.com</a>></span> \
wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 \
.8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div \
dir="ltr"><div>Hi all,</div><div><br></div><div>I'm trying to invoke the APIM \
<b>Create API</b> as below with the payload I have added below. \
</div><div><br></div><div>curl -H "Authorization: Bearer \
717e570e-5ccc-3c4a-9906-6bd81e<wbr>94a7db" -H \
"Content-Type:application/json<wbr>" -X POST -d @data.json <a \
href="http://127.0.0.1:9763/api/am/publisher/v0.10/apis" \
target="_blank">http://127.0.0.1:9763/api/am/p<wbr>ublisher/v0.10/apis</a></div><div><br></div><div>I'm \
getting the response as below when doing \
this</div><div><br></div><div>{"code":400,"message":"Bad \
Request","description":"Unreco<wbr>gnized property \
'thumbnailUrl'","moreInfo":"",<wbr>"error":[]}</div><div><br></div><div>But \
when I remove the <b>thumbnailUrl</b> from the payload this works perfectly. \
</div><div><br></div><div>What might be the reason for the bad request response when \
I'm sending the request with the \
thumbnailUrl?<br></div><div><br></div><div>I'm following the example from the Lab \
kit in [1] and using the AM 2.0. \
</div><div><br></div><div><br></div><div><b>Payload</b></div><div>========</div><div>{ \
</div><div> "sequences":[ </div><div><br></div><div> \
],</div><div> "tiers":[ </div><div> \
"Bronze",</div><div> "Gold"</div><div> ],</div><div> \
"thumbnailUrl":null,</div><div> \
"visibility":"PUBLIC",</div><div> "visibleRoles":[ \
</div><div><br></div><div> ],</div><div> "visibleTenants":[ \
</div><div><br></div><div> ],</div><div> \
"cacheTimeout":300,</div><div> \
"endpointConfig":"{\"producti<wbr>on_endpoints\":{\"url\":\"<a \
href="http://maps.google.com/maps/api/directions/%5C" \
target="_blank">http<wbr>://maps.google.com/maps/api/<wbr>directions/\</a>",\"config\":null}<wbr>,\"endpoint_type\":\"http \
\"}",</div><div> \
"subscriptionAvailability":nu<wbr>ll,</div><div> \
"subscriptionAvailableTenants<wbr>":[ </div><div><br></div><div> \
],</div><div> "destinationStatsEnabled":"Di<wbr>sabled",</div><div> \
"apiDefinition":"{\"paths\":{<wbr>\"\/*\":{\"g \
et\":{\"x-auth-typ<wbr>e\":\"Application\",\"x-thrott<wb \
r>ling-tier\":\"Unlimited\",\"<wbr>responses\":{\"200\&q \
uot;:{\"descri<wbr>ption\":\"OK\"}}}}},\"x-wso2-<wbr>security \
\":{\"apim\":{\"x-<wbr>wso2-scopes\":[]}},\"swagger\&quo \
t;<wbr>:\"2.0\",\"info\":{\"title\":\<wbr>"GoogleDirectionsAPI\",\"<wbr>description\":\"Calculates \
directions between locations\",\"contact\":{\"ema<wbr>il\":\"<a \
href="mailto:ApiPublisher@pizzashack.com" \
target="_blank">ApiPublisher@pizzashack<wbr>.com</a>\",\"name\":\" \
ApiPublisher<wbr>\"},\"version\":\"Beta\"}}",</div><div> \
"responseCaching":"Disabled",</div><div> \
"isDefaultVersion":true,</div><div> \
"gatewayEnvironments":"Produc<wbr>tion and Sandbox",</div><div> \
"businessInformation":{ </div><div> \
"technicalOwner":"ApiCreator",</div><div> \
"technicalOwnerEmail":"<a href="mailto:ApiCreator@pizzashack.com" \
target="_blank">ApiCrea<wbr>tor@pizzashack.com</a>",</div><div> \
"businessOwner":"ApiPublisher"<wbr>,</div><div> \
"businessOwnerEmail":"<a href="mailto:ApiPublisher@pizzashack.com" \
target="_blank">ApiPubli<wbr>sher@pizzashack.com</a>"</div><div> \
},</div><div> "transport":[ </div><div> \
"http",</div><div> "https"</div><div> ],</div><div> \
"tags":[ </div><div> "phone",</div><div> \
"multimedia",</div><div> "mobile"</div><div> \
],</div><div> "provider":"admin",</div><div> \
"version":"Beta",</div><div> \
"description":"Calculates directions between \
locations",</div><div> \
"name":"GoogleDirectionsAPI",</div><div> \
"context":"/googledirections"</div><div>}</div><div><br></div><div><br></div><div>[1] \
<a href="http://wso2.com/training/api-manager-developer-fundamentals#request_training_enroll" \
target="_blank">http://wso2.com/training/a<wbr>pi-manager-developer-fundament<wbr>als#request_training_enroll</a></div><span \
class="m_-8494307705942418027HOEnZb"><font color="#888888">-- <br><div \
class="m_-8494307705942418027m_7670757958138114891gmail_signature"><div \
dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div \
dir="ltr"><font size="1" face="monospace, monospace">Prakhash </font><span \
style="font-family:monospace,monospace;font-size:x-small">Sivakumar</span><font \
size="1" face="monospace, monospace"><br></font><div><span \
style="color:rgb(0,0,0);line-height:14.4444px"><font size="1" face="monospace, \
monospace">Software Engineer | WSO2 Inc</font></span></div><div><span \
style="color:rgb(0,0,0);font-family:verdana,sans-serif;font-size:x-small;line-height:14.4444px">Platform \
Security</span><font color="#888888" \
style="font-family:verdana,sans-serif;font-size:x-small;line-height:14.4444px"><font \
face="georgia, serif"> </font></font><span \
style="color:rgb(0,0,0);font-family:verdana,sans-serif;font-size:x-small;line-height:14.4444px">Team</span></div><div><span \
style="color:rgb(0,0,0);line-height:14.4444px"><font size="1" face="monospace, \
monospace">Mobile : <a href="tel:077%20151%200080" value="+94771510080" \
target="_blank">+94771510080</a></font></span></div><div><font size="1" \
face="monospace, monospace"><span style="color:rgb(0,0,0);line-height:14.4444px">Blog \
:</span><span style="color:rgb(0,0,0);line-height:14.4444px"> </span><a \
href="https://medium.com/@PrakhashS" \
target="_blank">https://medium.com/@Prakhash<wbr>S</a></font></div></div></div></div></div></div></div></div></div></div>
</font></span></div>
<br></div></div>______________________________<wbr>_________________<br>
Dev mailing list<br>
<a href="mailto:Dev@wso2.org" target="_blank">Dev@wso2.org</a><br>
<a href="http://wso2.org/cgi-bin/mailman/listinfo/dev" rel="noreferrer" \
target="_blank">http://wso2.org/cgi-bin/mailma<wbr>n/listinfo/dev</a><br> \
<br></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br \
clear="all"><div><br></div>-- <br><div class="m_-8494307705942418027gmail_signature" \
data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><font \
face="courier new, monospace"><b><i>Bhathiya Jayasekara</i></b></font><div><font \
face="courier new, monospace"><i>Senior Software \
Engineer,</i></font></div><div><font face="courier new, monospace"><i>WSO2 inc., <a \
href="http://wso2.com" target="_blank">http://wso2.com</a></i></font></div><div><font \
face="courier new, monospace"><i><br></i></font></div><div><font face="courier new, \
monospace"><i>Phone: <a href="tel:+94%2071%20547%208185" value="+94715478185" \
target="_blank">+94715478185</a></i></font></div><div><font face="courier new, \
monospace"><i>LinkedIn: <a href="http://www.linkedin.com/in/bhathiyaj" \
target="_blank">http://www.linkedin.<wbr>com/in/bhathiyaj</a></i></font></div><div><font \
face="courier new, monospace"><i>Twitter: <a href="https://twitter.com/bhathiyax" \
target="_blank">https://twitter.com/<wbr>bhathiyax</a></i></font></div><div><font \
face="courier new, monospace"><i>Blog: <a \
href="http://movingaheadblog.blogspot.com/" \
target="_blank">http://movingaheadblog.<wbr>blogspot.com</a></i></font></div></div></div></div></div>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div \
class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div \
dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><font size="1" \
face="monospace, monospace">Prakhash </font><span \
style="font-family:monospace,monospace;font-size:x-small">Sivakumar</span><font \
size="1" face="monospace, monospace"><br></font><div><span \
style="color:rgb(0,0,0);line-height:14.4444px"><font size="1" face="monospace, \
monospace">Software Engineer | WSO2 Inc</font></span></div><div><span \
style="color:rgb(0,0,0);font-family:verdana,sans-serif;font-size:x-small;line-height:14.4444px">Platform \
Security</span><font color="#888888" \
style="font-family:verdana,sans-serif;font-size:x-small;line-height:14.4444px"><font \
face="georgia, serif"> </font></font><span \
style="color:rgb(0,0,0);font-family:verdana,sans-serif;font-size:x-small;line-height:14.4444px">Team</span></div><div><span \
style="color:rgb(0,0,0);line-height:14.4444px"><font size="1" face="monospace, \
monospace">Mobile : +94771510080</font></span></div><div><font size="1" \
face="monospace, monospace"><span style="color:rgb(0,0,0);line-height:14.4444px">Blog \
:</span><span style="color:rgb(0,0,0);line-height:14.4444px"> </span><a \
href="https://medium.com/@PrakhashS" \
target="_blank">https://medium.com/@PrakhashS</a></font></div></div></div></div></div></div></div></div></div></div>
</div>
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic