[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">&lt;<a href="mailto:bhathiya@wso2.com" \
target="_blank">bhathiya@wso2.com</a>&gt;</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 &quot;<span \
style="color:rgb(51,51,51);font-family:menlo,monaco,consolas,&quot;courier \
new&quot;,monospace;font-size:12.6px;white-space:pre-wrap;background-color:rgb(232,232,232)">thumbnailUri</span>&quot; \
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">&lt;<a \
href="mailto:prakhash@wso2.com" target="_blank">prakhash@wso2.com</a>&gt;</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&#39;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 &quot;Authorization: Bearer \
717e570e-5ccc-3c4a-9906-6bd81e<wbr>94a7db&quot; -H \
&quot;Content-Type:application/json<wbr>&quot; -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&#39;m \
getting the response as below when doing \
this</div><div><br></div><div>{&quot;code&quot;:400,&quot;message&quot;:&quot;Bad \
Request&quot;,&quot;description&quot;:&quot;Unreco<wbr>gnized property \
&#39;thumbnailUrl&#39;&quot;,&quot;moreInfo&quot;:&quot;&quot;,<wbr>&quot;error&quot;:[]}</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&#39;m sending the request with the  \
thumbnailUrl?<br></div><div><br></div><div>I&#39;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>     &quot;sequences&quot;:[   </div><div><br></div><div>     \
],</div><div>     &quot;tiers&quot;:[   </div><div>         \
&quot;Bronze&quot;,</div><div>         &quot;Gold&quot;</div><div>     ],</div><div>  \
&quot;thumbnailUrl&quot;:null,</div><div>     \
&quot;visibility&quot;:&quot;PUBLIC&quot;,</div><div>     &quot;visibleRoles&quot;:[  \
</div><div><br></div><div>     ],</div><div>     &quot;visibleTenants&quot;:[   \
</div><div><br></div><div>     ],</div><div>     \
&quot;cacheTimeout&quot;:300,</div><div>     \
&quot;endpointConfig&quot;:&quot;{\&quot;producti<wbr>on_endpoints\&quot;:{\&quot;url\&quot;:\&quot;<a \
href="http://maps.google.com/maps/api/directions/%5C" \
target="_blank">http<wbr>://maps.google.com/maps/api/<wbr>directions/\</a>&quot;,\&quot;config\&quot;:null}<wbr>,\&quot;endpoint_type\&quot;:\&quot;http \
\&quot;}&quot;,</div><div>     \
&quot;subscriptionAvailability&quot;:nu<wbr>ll,</div><div>     \
&quot;subscriptionAvailableTenants<wbr>&quot;:[   </div><div><br></div><div>     \
],</div><div>     &quot;destinationStatsEnabled&quot;:&quot;Di<wbr>sabled&quot;,</div><div> \
&quot;apiDefinition&quot;:&quot;{\&quot;paths\&quot;:{<wbr>\&quot;\/*\&quot;:{\&quot;g \
et\&quot;:{\&quot;x-auth-typ<wbr>e\&quot;:\&quot;Application\&quot;,\&quot;x-thrott<wb \
r>ling-tier\&quot;:\&quot;Unlimited\&quot;,\&quot;<wbr>responses\&quot;:{\&quot;200\&q \
uot;:{\&quot;descri<wbr>ption\&quot;:\&quot;OK\&quot;}}}}},\&quot;x-wso2-<wbr>security \
\&quot;:{\&quot;apim\&quot;:{\&quot;x-<wbr>wso2-scopes\&quot;:[]}},\&quot;swagger\&quo \
t;<wbr>:\&quot;2.0\&quot;,\&quot;info\&quot;:{\&quot;title\&quot;:\<wbr>&quot;GoogleDirectionsAPI\&quot;,\&quot;<wbr>description\&quot;:\&quot;Calculates \
directions between locations\&quot;,\&quot;contact\&quot;:{\&quot;ema<wbr>il\&quot;:\&quot;<a \
href="mailto:ApiPublisher@pizzashack.com" \
target="_blank">ApiPublisher@pizzashack<wbr>.com</a>\&quot;,\&quot;name\&quot;:\&quot; \
ApiPublisher<wbr>\&quot;},\&quot;version\&quot;:\&quot;Beta\&quot;}}&quot;,</div><div> \
&quot;responseCaching&quot;:&quot;Disabled&quot;,</div><div>     \
&quot;isDefaultVersion&quot;:true,</div><div>     \
&quot;gatewayEnvironments&quot;:&quot;Produc<wbr>tion and Sandbox&quot;,</div><div>   \
&quot;businessInformation&quot;:{   </div><div>         \
&quot;technicalOwner&quot;:&quot;ApiCreator&quot;,</div><div>         \
&quot;technicalOwnerEmail&quot;:&quot;<a href="mailto:ApiCreator@pizzashack.com" \
target="_blank">ApiCrea<wbr>tor@pizzashack.com</a>&quot;,</div><div>         \
&quot;businessOwner&quot;:&quot;ApiPublisher&quot;<wbr>,</div><div>         \
&quot;businessOwnerEmail&quot;:&quot;<a href="mailto:ApiPublisher@pizzashack.com" \
target="_blank">ApiPubli<wbr>sher@pizzashack.com</a>&quot;</div><div>     \
},</div><div>     &quot;transport&quot;:[   </div><div>         \
&quot;http&quot;,</div><div>         &quot;https&quot;</div><div>     ],</div><div>   \
&quot;tags&quot;:[   </div><div>         &quot;phone&quot;,</div><div>         \
&quot;multimedia&quot;,</div><div>         &quot;mobile&quot;</div><div>     \
],</div><div>     &quot;provider&quot;:&quot;admin&quot;,</div><div>     \
&quot;version&quot;:&quot;Beta&quot;,</div><div>     \
&quot;description&quot;:&quot;Calculates directions between \
locations&quot;,</div><div>     \
&quot;name&quot;:&quot;GoogleDirectionsAPI&quot;,</div><div>     \
&quot;context&quot;:&quot;/googledirections&quot;</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