<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">You can’t just pass “0” as the changeset id.</div><div class=""><br class=""></div><div class="">Your app will need to create a changeset first with :</div><div class=""><a href="http://wiki.openstreetmap.org/wiki/API_v0.6#Create:_PUT_.2Fapi.2F0.6.2Fchangeset.2Fcreate" class="">http://wiki.openstreetmap.org/wiki/API_v0.6#Create:_PUT_.2Fapi.2F0.6.2Fchangeset.2Fcreate</a></div><div class=""><br class=""></div><div class="">This diagram talks a bit about the flow of how to create a changeset, issue updates against it, then close the changeset:</div><div class=""><a href="http://wiki.openstreetmap.org/wiki/File:OSM_API0.6_Changeset_successful_creation_V0.1.png" class="">http://wiki.openstreetmap.org/wiki/File:OSM_API0.6_Changeset_successful_creation_V0.1.png</a></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><br class=""><div><blockquote type="cite" class=""><div class="">On Jun 14, 2016, at 11:41 AM, toni hernández <<a href="mailto:toni@sigte.udg.edu" class="">toni@sigte.udg.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">
  

    <meta http-equiv="content-type" content="text/html; charset=windows-1252" class="">
  
  <div bgcolor="#FFFFFF" text="#000000" class="">
    Hi everyone,<br class="">
    <br class="">
    I am trying to display OSM data into my web map as well as other
    custom layers.<br class="">
    One of the goals of my web application is to upload data from my
    application to the osm database.  I have been reading this
    <a class="moz-txt-link-freetext" href="http://wiki.openstreetmap.org/wiki/API_v0.6#Elements">http://wiki.openstreetmap.org/wiki/API_v0.6#Elements</a> but still I do
    not understand how a PUT request functions. I have so much to
    learn....<br class="">
    <br class="">
    After authentificating with osmauth.js I try this code without any
    success. I get a 401 error.<br class="">
    <br class="">
    var xml_string = '<?xml version="1.0" encoding="UTF-8"?>
    <osm version="0.6" generator="MyOpenstreetmapApp"><node
    changeset="0" lat="41.983910" lon="2.816094"><tag k="shop"
    v="supermarket"/></node></osm>';<br class="">
    <br class="">
    ajaxurl= <a class="moz-txt-link-rfc2396E" href="http://www.openstreetmap.org/api/0.6/node/create">"http://www.openstreetmap.org/api/0.6/node/create"</a>;<br class="">
    <br class="">
    $.ajax({<br class="">
        url: ajaxurl,<br class="">
        data: xml_string, <br class="">
        type: 'PUT',<br class="">
        contentType: "text/xml",<br class="">
        dataType: "text",<br class="">
        success : function (resp){console.debug(resp)},<br class="">
        error : function (xhr, ajaxOptions, thrownError){  <br class="">
            console.log(xhr.status);          <br class="">
            console.log(thrownError);<br class="">
        } <br class="">
    });        <br class="">
    <br class="">
    Do I need to include oauth_secret and oauth_consumer_key from the
    authentification proccess in the ajax request?<br class="">
    <br class="">
    Any help will be really apreciated.<br class="">
    Thanks <br class="">
    <div class="moz-signature">-- <br class="">
      <span style="font-size:8.5pt" class="">
        <b class="">Toni Hernández Vallès</b>
        <br class="">
        Servei de Sistemes d'Informació Geogràfica i Teledetecció<br class="">
        -<br class="">
        Universitat de Girona<br class="">
        <b class="">SIGTE</b><br class="">
        -<br class="">
        Pl. Ferrater Mora 1<br class="">
        17071 Girona<br class="">
        Tel +34 972 418 039 (7026 intern)<br class="">
        <a href="mailto:toni@sigte.udg.edu" class="">toni@sigte.udg.edu</a>
        <br class="">
        <br class="">
        <a href="http://www.sigte.udg.edu/" class="">http://www.sigte.udg.edu</a><br class="">
        Twitter <a href="http://twitter.com/SIGTE_UDG" class="">http://twitter.com/SIGTE_UDG</a><br class="">
        <br class="">
      </span></div>
  </div>

_______________________________________________<br class="">dev mailing list<br class=""><a href="mailto:dev@openstreetmap.org" class="">dev@openstreetmap.org</a><br class="">https://lists.openstreetmap.org/listinfo/dev<br class=""></div></blockquote></div><br class=""></body></html>