Why is Silverpop not accepting my XML API call? - api

I’m working on running a few tests on the Silverpop API, toward an eventual goal of uploading CSVs each evening to update a Silverpop table. I was able to successfully upload csv and xml files and get an oauth access token for the API. However, I’m having trouble with my first actual call.
Here is what I am attempting to send:
<?xml version="1.0" encoding="ISO-8859-1"?>
<Envelope>
<Body>
<ImportList>
<MAP_FILE>silverPopTest.xml</MAP_FILE>
<SOURCE_FILE>silverPopTest.csv</SOURCE_FILE>
<EMAIL>Nicholas#xxxxxxxxxxxxxxxxxxxx.com</EMAIL>
</ImportList>
</Body>
</Envelope>
And here is the 'fault string’ that I am receiving back:
Missing 'xml'parameter
I’m not sure what that means.
I believe I am including all of the required parameters for this command per the docs. I have tried both with and without the “xml” line, as application/xml and text/xml, and a variety of other variations. For reference, here is the code for my entire call:
<cfhttp method="POST" url="https://api3.ibmmarketingcloud.com/XMLAPI">
<cfhttpparam type="header" name="Content-Type" value="application/xml" />
<cfhttpparam type="header" name="Accept" value="application/xml">
<cfhttpparam type="header" name="Authorization" value="Bearer #accessToken#" />
<cfhttpparam type="body" value="#xmlBody#">
</cfhttp>
This is the error xml:
<Envelope><Body><RESULT><SUCCESS>false</SUCCESS></RESULT><Fault><Request/><FaultCode/><FaultString>Missing 'xml'parameter</FaultString><detail><error><errorid>52</errorid><module/><class>SP.API</class><method/></error></detail></Fault></Body></Envelope>
This is my CSV file:
"userid","Email","firstName","lastName"
"123fdasTEST1asdf321","nicholas+test1#xxxxxxxxxxxxxxxxxxx.com","testFirst 1","testLast 1"
"123fdasTEST2asdf321","nicholas+test2#xxxxxxxxxxxxxxxxxxx.com","testFirst 2","testLast 2"
This is my 'map' file:
<LIST_IMPORT>
<LIST_INFO>
<ACTION>ADD_AND_UPDATE</ACTION>
<LIST_ID>9999999</LIST_ID>
<FILE_TYPE>0</FILE_TYPE>
<HASHEADERS>true</HASHEADERS>
</LIST_INFO>
<COLUMNS>
<COLUMN>
<NAME>userid</NAME>
<TYPE>0</TYPE>
<IS_REQUIRED>true</IS_REQUIRED>
<KEY_COLUMN>true</KEY_COLUMN>
</COLUMN>
<COLUMN>
<NAME>Email</NAME>
<TYPE>9</TYPE>
<IS_REQUIRED>true</IS_REQUIRED>
</COLUMN>
<COLUMN>
<NAME>firstName</NAME>
<TYPE>0</TYPE>
<IS_REQUIRED>true</IS_REQUIRED>
</COLUMN>
<COLUMN>
<NAME>lastName</NAME>
<TYPE>0</TYPE>
<IS_REQUIRED>true</IS_REQUIRED>
</COLUMN>
</COLUMNS>
<MAPPING>
<COLUMN>
<INDEX>1</INDEX>
<NAME>userid</NAME>
<INCLUDE>true</INCLUDE>
</COLUMN>
<COLUMN>
<INDEX>2</INDEX>
<NAME>EMAIL</NAME>
<INCLUDE>true</INCLUDE>
</COLUMN>
<COLUMN>
<INDEX>3</INDEX>
<NAME>firstName</NAME>
<INCLUDE>true</INCLUDE>
</COLUMN>
<COLUMN>
<INDEX>4</INDEX>
<NAME>lastName</NAME>
<INCLUDE>true</INCLUDE>
</COLUMN>
</MAPPING>
</LIST_IMPORT>

After working with Silverpop customer support, who said my files and call were working just fine for them, we determined the problem. The XML declaration:
<?xml version="1.0" encoding="ISO-8859-1"?>
Needs to be the first thing in the document. Although it appears that it is above, there are actually several tab stops before it. While Silverpop's tools were trimming those extraneous characters out, ColdFusion was send it exactly as it was, and Silverpop's server just returned a generic error.
The solution was to remove those tab stops, or trim the xml right before sending.

Related

Liquibase changeset changeLogPropertyDefined is not working

In liquibase I want to execute a particular change set based on the 'context' property value.
In this case I have passed -Dcontext=local (I've checked this values is getting picked properly) through command line and tried to check that property within my changeset by using changeLogPropertyDefined. But It's not working..
Please find below my changeset
<changeSet id="1" author="dm">
<preConditions onFail="MARK_RAN" onSqlOutput="TEST">
<changeLogPropertyDefined property="context" value="local"/>
</preConditions>
<createTable tableName="accountold">
<column autoIncrement="true" name="id" type="BIGINT">
<constraints nullable="false" primaryKey="true"/>
</column>
<column name="version" type="BIGINT">
<constraints nullable="false"/>
</column>
</createTable>
</changeSet>
You should add the "link" to the property in the top of your changeset file to reference value is passed from jvm args:
<property name="context" value="${context}"/>
Then you could use your property in precondition and anywhere you want in this changeset.
P.S. Maybe it's will be better to give different name for jvm arg and lb property to avoid ambiguity of interpretation.

Liquibase loadData as string, not CLOB resource

The Problem
I recently upgraded Liquibase to 3.6.2 from 3.4.2.
Loading seed data from a CSV into text fields now results in a CLOB resource error. Before it would simply insert the text as a value.
The Setup
I'm using Liquibase to manage migrations of my data.
I have a table with an code and description column. description is of type TEXT.
<changeSet author="" id="create-table-degrees">
<createTable tableName="degrees">
<column name="code"
type="varchar(2)">
<constraints primaryKey="true"/>
</column>
<column name="description"
type="text">
<constraints unique="true"/>
</column>
</createTable>
<rollback>
<dropTable tableName="degrees"/>
</rollback>
</changeSet>
I have seed data in a CSV:
code,description
"D1","MASTERS"
"D2","DOCTORATE"
I load it using loadData:
<changeSet author="" id="seed-degrees">
<loadData file="seeds/degrees.csv"
tableName="degrees" />
</changeSet>
The Error
Unexpected error running Liquibase: CLOB resource not found: MASTERS
The Question
Is there a way to keep Liquibase from interpreting seed values as file paths instead of strings, or do I need to manually define the column types as String in loadData.
e.g. I would like to avoid having to modify the old changeSet to:
<changeSet author="" id="seed-degrees">
<loadData file="seeds/degrees.csv"
tableName="roles">
<column name="description" type="string" />
</loadData>
</changeSet>
The workaround listed in CORE-3287: Anver S December 3, 2018, 3:07 PM
While adding an explicit column type definition as defined in original
stackoverflow post
<column name="description" type="string" />
does the trick - for me it effectively requires to update already
applied changesets which ideally I'd try to avoid.

Customization on Task Board In Team Foundation Server not reflecting

Hi so we are currently exploring Team Foundation server 2015 on-premise as part of our DevOps process.
Currently I'm trying out customization of the task board to add a "Pull Request" column/state in the board.
Steps ive done so far:
Exported the Task.xml file from the project "Wittest" in the Demoprojectcollection
witadmin exportwitd /collection:http://192.168.123.456:8080/tfs/DEMOPROJECTCOLLECTION /p:"Wittest" /n:Task /f:Task.xml
Modified xml to add the Code Review State
<STATE value="Pull Request">
<FIELDS>
<FIELD refname="Microsoft.VSTS.Common.ClosedDate">
<EMPTY />
</FIELD>
</FIELDS>
</STATE>
Added transitions for the new state
Uploaded the updated file using with admin again
witadmin importwitd /collection:http://192.168.123.456:8080/tfs/DEMOPROJECTCOLLECTION /p:"Wittest" /f:Task.xml
Check the board but columns stayed the same 3 columns "To Do" "In Progress" "Done"
Exported the Task.xml again and saw the xml was updated but I am unsure why I does not reflect the changes in the board though.
Would really appreciate the nudge to the right direction for this please
After adding the state in the task work item type, you also need to modify the process configuration file.
Try to use witadmin exportprocessconfig/importprocessconfig command to import and export process configuration, and add the pull request state in the TaskBacklog:
<TaskBacklog category="Microsoft.TaskCategory" parent="Microsoft.RequirementCategory" pluralName="Tasks" singularName="Task" workItemCountLimit="1000">
<AddPanel>
<Fields>
<Field refname="System.Title" />
</Fields>
</AddPanel>
<Columns>
<Column width="400" refname="System.Title" />
<Column width="100" refname="System.State" />
<Column width="100" refname="System.AssignedTo" />
<Column width="50" refname="Microsoft.VSTS.Scheduling.RemainingWork" />
</Columns>
<States>
<State type="Proposed" value="To Do" />
<State type="InProgress" value="In Progress" />
<State type="InProgress" value="Pull Request" />
<State type="Complete" value="Done" />
</States>
</TaskBacklog>
I've tested on my side, it's working:

Silverpop <ImportList> API error "Mapping Failed. Cannot Import Column: RECIPIENT_ID Unable to continue"

I'm running into the below error
Mapping Failed. Cannot Import Column: RECIPIENT_ID Unable to continue
I’m using API method (snippet below), and
<Envelope>
<Body>
<ImportList><MAP_FILE>ODS_To_Silverpop_Mapping.XML</MAP_FILE>
<SOURCE_FILE>ODS_To_Silverpop_20170123171113.TXT</SOURCE_FILE></ImportList>
</Body>
</Envelope>
and passing the XML file for mapping information (snippet below), along with the raw data file (not attached here). As per the API documentation, I'm saving these two files in the silverpop FTP folder and making the API call. This code is working if I don't use the 'RECIPIENT_ID' (which is the auto generated hidden system field) in the mapping xml file (in columns mapping list and in the sync fields list), and use some other key to sync. However, in this specific case, I need too use the RECIPIENT_ID as there is no other reliable field. Does any one have experience with the Silverpop ImportList API method? and thoughts about this issue?
<?xml version="1.0" encoding="UTF-8"?>
<LIST_IMPORT>
<LIST_INFO>
<ACTION>ADD_AND_UPDATE</ACTION>
<LIST_ID>23232323</LIST_ID>
<FILE_TYPE>0</FILE_TYPE>
<HASHEADERS>true</HASHEADERS>
</LIST_INFO>
<SYNC_FIELDS>
<SYNC_FIELD>
<NAME>RECIPIENT_ID</NAME>
</SYNC_FIELD>
</SYNC_FIELDS>
<MAPPING>
<COLUMN>
<INDEX>1</INDEX>
<NAME>Email</NAME>
<INCLUDE>true</INCLUDE>
</COLUMN>
<COLUMN>
<INDEX>2</INDEX>
<NAME>RECIPIENT_ID</NAME>
<INCLUDE>true</INCLUDE>
</COLUMN>
<COLUMN>
<INDEX>3</INDEX>
<NAME>FirstName</NAME>
<INCLUDE>true</INCLUDE>
</COLUMN>
<COLUMN>
<INDEX>4</INDEX>
<NAME>LastName</NAME>
<INCLUDE>true</INCLUDE>
</COLUMN>
<INDEX>5</INDEX>
<NAME>Last Modified Date</NAME>
<INCLUDE>false</INCLUDE>
</COLUMN>
</MAPPING>
</LIST_IMPORT>
Yes In your mapping XML file please Add
<USE_RECIPIENT_ID>true</USE_RECIPIENT_ID> inside list_info
below is the snippet
<LIST_INFO>
<ACTION>ADD_AND_UPDATE</ACTION>
<LIST_ID>23232323</LIST_ID>
<FILE_TYPE>0</FILE_TYPE>
<HASHEADERS>true</HASHEADERS>
<USE_RECIPIENT_ID>true</USE_RECIPIENT_ID>
</LIST_INFO>

How does one access analytical views using odata?

I have an analytical view and an .xsodata to expose it to web. The question is how is the access url formed? HANA documentation is insufficient here, and the same for the moderated SCN.
Here is my func_x_cview.xsodata:
service namespace "CTag" {
"MyPackage::FUNC_X_CALC_VIEW" as "CView" keys generate local "ID"
parameters via entity "InputParams" ;
}
http://awshana:8000/package/path/to/xsodata/file/$metadata shows:
<EntityType Name="InputParamsType">
<Key>
<PropertyRef Name="ATTRIBUTE"/>
<PropertyRef Name="ATTRIBUTE_VALUE"/>
<PropertyRef Name="category"/>
<PropertyRef Name="from_date"/>
<PropertyRef Name="process"/>
<PropertyRef Name="to_date"/>
</Key>
<Property Name="ATTRIBUTE" Type="Edm.String" Nullable="false" MaxLength="50"/>
<Property Name="ATTRIBUTE_VALUE" Type="Edm.String" Nullable="false" MaxLength="100"/>
<Property Name="category" Type="Edm.String" Nullable="false" MaxLength="50"/>
<Property Name="from_date" Type="Edm.DateTime" Nullable="false"/>
<Property Name="process" Type="Edm.String" Nullable="false" MaxLength="50"/>
<Property Name="to_date" Type="Edm.DateTime" Nullable="false"/>
<NavigationProperty Name="Results" Relationship="CTag.InputParams_CViewType"
FromRole="InputParamsPrincipal"
ToRole="CViewDependent"/>
</EntityType>
What should be the access url? Does the xsodata need any tweaking?
Thanks
--EDIT--
When trying url like suggested by ongis-nade to http://awshana:8000/Pkg/Proj_X/services/tagA.xsodata/InputParams%28%27category%27=%27abcd%27%29/Results?$select=exception_name then I get an error like the following:
<error>
<code/>
<message xml:lang="en-US">
No property ''category'' exists in type 'CTag.InputParamsType'.
</message>
</error>
This is confusing as we can see a property named category in the entity named InputParamsType in the $metadata query.
Removing the single quotes around category (also tried double-quoting) gives
http://awshana:8000/Pkg/Proj_X/services/tagA.xsodata/InputParams%28category=%27abcd%27%29/Results?$select=exception_name
<error>
<code/>
<message xml:lang="en-US">
The number of keys specified in the URI at position 27 does not match number of key properties for the resource 'CTag.InputParamsType'.
</message>
</error>
So a single quote is needed.
A step closer but still the same question. Do I need to qualify each parameter name somehow?
Thanks.
I believe the URL will be formed as:
http://awshana:8000/Pkg/Proj_X/services/tagA.xsodata/InputParams(category='abcd')/Results?
The "InputParams" name is of course reflected in your service definition
I also found a good example here: http://scn.sap.com/community/developer-center/hana/blog/2013/01/22/rest-your-models-on-sap-hana-xs
May be a bit late: But you have to specify a value for each key parameter.
Note also, that timestamps must be specified in ODatas Edm.DateTime format.
Example for your service:
http://server:8080/pathToService/tagA.xsodata/InputParams(ATTRIBUTE='?',ATTRIBUTE_VALUE='?',category='?',from_date=datetime'2014-01-01T00:00:00',process='?',to_date=datetime'2014-09-01T00:00:00')/Results