08-22-2014 04:32 AM
I am using Poster for consuming SocialMiner APIs. I am using Create Campaign API, Following are the URL, HTTP method and HTTP request which i am using for the API.
URL: http://192.168.200.163/ccp-webapp/ccp/campaign
Actions: POST
Content Type: application/xml
HTTP Request Code:
<Campaign>
<name>MyTestCampaign</name>
<publicId>MyTestCampaign</publicId>
<description>This is my test campaign</description>
<includeExpr>Cisco Expert Advisor</includeExpr>
<excludeExpr>ICM</excludeExpr>
<feeds>
<feed>
http://192.168.200.163/ccp-webapp/ccp/feed/100078
</feed>
</feeds>
<filters>
<filter>
http://192.168.200.163/ccp-webapp/ccp/filter/100083
</filter>
</filters>
</Campaign>
And when i click POST function i get the following error response.
Status: 400 Bad Request
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<apiErrors>
<apiError>
<errorData>feed</errorData>
<errorMessage>For input string: "100078
"</errorMessage>
<errorType>invalidInput</errorType>
</apiError>
</apiErrors>
Can any one help me in figuring this out please...?
Solved! Go to Solution.
08-22-2014 05:42 AM
Hello. The problem you are having is that you've put the value of the feed attribute (http://192.168.200.163/ccp-webapp/ccp/feed/100078) on its own line, adding Line-Feed characters into the value.
Put the feed and filter attribute value on the same line and you should be fine:
<Campaign>
<name>MyTestCampaign</name>
<publicId>MyTestCampaign</publicId>
<description>This is my test campaign</description>
<includeExpr>Cisco Expert Advisor</includeExpr>
<excludeExpr>ICM</excludeExpr>
<feeds>
<feed>http://192.168.200.163/ccp-webapp/ccp/feed/100078</feed>
</feeds>
<filters>
<filter>http://192.168.200.163/ccp-webapp/ccp/filter/100083</filter>
</filters>
</Campaign>
Cheers,
Ryan (SocialMiner dev)
08-22-2014 04:57 AM
It would appear the feed url you are specifying on the campaign is invalid.
Try getting a list of feeds and be sure the feed id in your Campaign is correct:
http:///ccp-webapp/ccp/feed?summary=false
08-22-2014 05:09 AM
I have already done this, i.e. got the list of feeds and made sure that id is correct even then getting an error..
08-22-2014 05:42 AM
Hello. The problem you are having is that you've put the value of the feed attribute (http://192.168.200.163/ccp-webapp/ccp/feed/100078) on its own line, adding Line-Feed characters into the value.
Put the feed and filter attribute value on the same line and you should be fine:
<Campaign>
<name>MyTestCampaign</name>
<publicId>MyTestCampaign</publicId>
<description>This is my test campaign</description>
<includeExpr>Cisco Expert Advisor</includeExpr>
<excludeExpr>ICM</excludeExpr>
<feeds>
<feed>http://192.168.200.163/ccp-webapp/ccp/feed/100078</feed>
</feeds>
<filters>
<filter>http://192.168.200.163/ccp-webapp/ccp/filter/100083</filter>
</filters>
</Campaign>
Cheers,
Ryan (SocialMiner dev)
08-22-2014 05:48 AM
So nice of you @Ryan...You are 100% right, now i am on my way...
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide