Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
Reply
Highlighted
Bronze Super Contributor
Posts: 113
Registered: ‎07-27-2009

Sample creating a Ticket using SDATA and CURL (in this case CURL for Windows)

Here a sample creating a Ticket using SDATA and CURL (in this case CURL for Windows)

 

Download CURL from here.

 

Create a Textfile and insert text OR Download attached file

Save file as .cmd or .bat in the same directory as curl

Replace SERVER

Replace PORT

Replace USERNAME (e. g. admin)

Replace PASSWORD

Replace ACCOUNTID

Replace CONTACTID

Replace OWNERID

Replace VIACODEID

Replace STATUSCODEID

 

Attention:

-- Within the file, whole text needs to be in 1 line!!!

-- Emoticons are colon and P

 

curl --url http://SERVERSmiley TongueORT/sdata/slx/dynamic/-/Tickets('') --user USERNAMESmiley TongueASSWORD --data "<?xml version='1.0' encoding='utf-8'?><entry xmlns:sdata='http://schemas.sage.com/sdata/2008/1' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns='http://www.w3.org/2005/Atom'><sdataSmiley Tongueayload><Ticket xmlns='http://schemas.sage.com/dynamic/2007'><Account sdata:key='ACCOUNTID' /><Contact sdata:key='CONTACTID' /><Owner sdata:key='OWNERID' /><ViaCode>VIACODEID</ViaCode><StatusCode>STATUSCODEID</StatusCode><Subject>BootCamp Rocks</Subject><TicketProblem><Notes>Ticket created via SDATA</Notes></TicketProblem></Ticket></sdataSmiley Tongueayload></entry>" --header "Content-Type: application/atom+xml; type=entry"
 

rem remove rem in the next line for seeing the result

rem pause 

 

 

For better reading, same code again

 

curl

--url http://SERVERSmiley TongueORT/sdata/slx/dynamic/-/Tickets('')

--user USERNAMESmiley TongueASSWORD

--data

"

<?xml version='1.0' encoding='utf-8'?>

  <entry xmlns:sdata='http://schemas.sage.com/sdata/2008/1' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns='http://www.w3.org/2005/Atom'>

    <sdataSmiley Tongueayload>

      <Ticket xmlns='http://schemas.sage.com/dynamic/2007'>

        <Account sdata:key='ACCOUNTID' />

        <Contact sdata:key='CONTACTID' />

        <Owner sdata:key='OWNERID' />

        <ViaCode>VIACODEID</ViaCode>

        <StatusCode>STATUSCODEID</StatusCode>

        <Subject>BootCamp Rocks</Subject>

        <TicketProblem>

          <Notes>Ticket created via SDATA</Notes>

        </TicketProblem>

      </Ticket>

    </sdataSmiley Tongueayload>

  </entry>

"

--header "Content-Type: application/atom+xml; type=entry"

 

 

Thanks to BootCamp Team 2011. Sample of C# (Adding Ticket) and Fiddler was a great help to get this solved.

Regards
Rainer Raebiger