Authentication and basics

We use HTTP basic authentication over HTTPS protocol. Please do not send any secure data via HTTP.
XML should be sent as HTTP POST body without special encoding, Content-Type should be set as text/xml.
Dump of HTTP POST request:

    POST /api/v1/import/568bf423700e0225bb12733d/any HTTP/1.1
    Host: www.careersitecloud.com
    Authorization: Basic NTYwNTU4MmYwY2YyYjBiMTQ0NWRlOTE2OjllZGU4ZDEyLTE3OGItNDY1MS04MmIwLWM5OWY2NmI2MmUwMA==
    User-Agent: curl/7.43.0
    Accept: */*
    Content-Type: text/xml
    Content-Length: 708

    <post><job><address>address</address><applyemail> applyEmail </applyemail><applyredirect> applyRedirect </applyredirect><category> category </category><city> city </city><country> country </country><description> description </description><education> education </education><experience> experience </experience><expired> expired </expired><featured> featured </featured><hash> hash </hash><hours> hours </hours><importsourceid> importSourceId </importsourceid><linkedids> linkedIds </linkedids><ref> ref </ref><relocation> relocation </relocation><salary> salary </salary><source>source</source><state> state </state><status> status </status><title>title</title><type> type </type><zip> zip </zip></job></post>
    

Dump of HTTP POST response:

    HTTP/1.1 200 OK
    Server: nginx/1.9.3 (Ubuntu)
    Date: Wed, 06 Jan 2016 15:14:12 GMT
    Content-Type: text/plain;charset=ISO-8859-1
    Content-Length: 398
    Connection: keep-alive

    <response status="success" state="finished">
     <item status="success" state="updated" hash="e231baacd1005a785b45dedc7901f1ad"></item>
     <item status="error" state="duplicate">
      <reason>
       This is duplicate, same item is already processed. Hash: e231baacd1005a785b45dedc7901f1ad
      </reason>
     </item>
     <item status="success" state="updated" hash="fda5b7a8a5c1f9a68ac3342afba2f6d4"></item>
    </response>
    

Example of using cURL command line utility:
curl -H "Content-Type: text/xml" -X POST -u {SITE ID}:{ACCESS TOKEN} --data @in.xml "https://www.careersitecloud.com/api/v1/import/{IMPORT CONFIG ID}/{ITEMS NAMESPACE}", where

{SITE ID}
5559f4030cf2b137fbab98d3
{ACCESS TOKEN}
contact site owner in order to get this value
{IMPORT CONFIG ID}
55cc5c34e4b0dc0dc8634713
{ITEMS NAMESPACE}
any alphanumeric value that used by our system to group posted items together (e.g. "e1" means jobs of employer 1 and "e2" means jobs of employer 2). If you do not want jobs to be diferrentiated just use any constant value through all your postings
curl ... -u user:pass ...
cURL's parameter to set HTTP basic user and password
curl ... -X POST ...
cURL's parameter to set HTTP POST method
curl ... --data @in.xml ...
cURL's parameter to get XML file from "in.xml" file
curl ... -H "Content-Type: text/xml" ...
cURL's parameter to set content type to text/xml

So, the final cURL command sample (do not forget to change the access token value):
curl -H "Content-Type: text/xml" -X POST -u 5559f4030cf2b137fbab98d3:9ede8d12-178b-4651-82b0-c99f66b62e00 --data @in.xml "https://www.careersitecloud.com/api/v1/import/55cc5c34e4b0dc0dc8634713/any"

Posting items. Make request

Your configuration set up is:


Sync field(s)
ref
Item's root XPath
/source/job
-----
-----
Item's field
XPath (if field does not have mapping it will be empty)
address
applyEmail
applyRedirect


/source/job/url
category
/source/job/category
city
/source/job/city
country
/source/job/country
description
/source/job/description
education
/source/job/education
experience
/source/job/experience
expired
featured
hash
hours
importSourceId
linkedIds
ref






/source/job/referencenumber
relocation
salary

/source/job/salary
source
/source/job/url
state
/source/job/state
title
/source/job/title
type
/source/job/type
zip
/source/job/postalcode
-----
-----
Item's field
Date format
expired
MM/dd/yyyy


Our system uses XPath to read items from XML. It is possible to provide as one as many typical items within one XML file. To be properly recognized all of them should be passed under one specific XML tag which will be the root of these items. Sample for job items:

<post>
    <jobs>
        <job>
            <field1></field1>
            ...
        </job>
        <job>
            <field1></field1>
            ...
        </job>
        <job>
            <field1></field1>
            ...
        </job>
    </jobs>
</post>

The item's root XPath: /post/jobs/job and the field's "field1" XPath: /post/jobs/job/field1

Your XML sample:

<source>
 <job>
  <url>
   applyRedirect
  </url>
  <category>
   category
  </category>
  <city>
   city
  </city>
  <country>
   country
  </country>
  <description>
   description
  </description>
  <education>
   education
  </education>
  <experience>
   experience
  </experience>
  <referencenumber>
   ref
  </referencenumber>
  <salary>
   salary
  </salary>
  <url>
   source
  </url>
  <state>
   state
  </state>
  <title>title</title>
  <type>
   type
  </type>
  <postalcode>
   zip
  </postalcode>
 </job></source>

cURL with XML sample:
echo "<source><job><url> applyRedirect </url><category> category </category><city> city </city><country> country </country><description> description </description><education> education </education><experience> experience </experience><referencenumber> ref </referencenumber><salary> salary </salary><url> source </url><state> state </state><title>title</title><type> type </type><postalcode> zip </postalcode></job></source>" | curl -H "Content-Type: text/xml" -X POST -u 5559f4030cf2b137fbab98d3:9ede8d12-178b-4651-82b0-c99f66b62e00 --data @- "https://www.careersitecloud.com/api/v1/import/55cc5c34e4b0dc0dc8634713/any"

Posting items. Handling response

The overall response structure:

<response status="success" state="finished">
 <item status="success" state="updated" hash="e231baacd1005a785b45dedc7901f1ad"></item>
 <item status="error" state="duplicate">
  <reason>
   This is duplicate, same item is already processed. Hash: e231baacd1005a785b45dedc7901f1ad
  </reason>
 </item>
 <item status="success" state="updated" hash="fda5b7a8a5c1f9a68ac3342afba2f6d4"></item>
</response>

Response is root tag which has two attributes: status and state. Status shown processing result and state will show on which step processing stopped. F.e. XML may be invalid and then you will see someting like:

<response status="error" state="processing">
 <reason>
  Unexpected error
 </reason>
 <stack>
  com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '&lt;' (code 60) excepted space, or '&gt;' or "/&gt;" at [row,col {unknown-source}]: [1,6] at com.ctc.wstx.sr.StreamScanner.throwUnexpectedChar(StreamScanner.java:647) at com.ctc.wstx.sr.BasicStreamReader.handleNsAttrs(BasicStreamReader.java:2996) at com.ctc.wstx.sr.BasicStreamReader.handleStartElem(BasicStreamReader.java:2963) at com.ctc.wstx.sr.BasicStreamReader.handleRootElem(BasicStreamReader.java:2100) at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2080) ...
 </stack>
</response>

If XML was OK then each item will have his own posting result in tag "item". Again attribute status means status of posting and state means on which step were problem if it was.