cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
849
Views
7
Helpful
4
Replies

Error Creating Campaign Via Web Services

Hashmat Khan
Level 1
Level 1

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: &quot;100078

&quot;</errorMessage>

        <errorType>invalidInput</errorType>

    </apiError>

</apiErrors>

Can any one help me in figuring this out please...?

1 Accepted Solution

Accepted Solutions

rysmart
Level 1
Level 1

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)

View solution in original post

4 Replies 4

dlender
Level 6
Level 6

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

I have already done this, i.e. got the list of feeds and made sure that id is correct even then getting an error..

rysmart
Level 1
Level 1

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)

So nice of you @Ryan...You are 100% right, now i am on my way...

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: