<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">To create a changeset you need change your xml_string too, not just the endpoint.</div><div class=""><br class=""></div><div class="">see the example here:</div><div class=""><a href="http://wiki.openstreetmap.org/wiki/API_v0.6#Update:_PUT_.2Fapi.2F0.6.2Fchangeset.2F.23id" class="">http://wiki.openstreetmap.org/wiki/API_v0.6#Update:_PUT_.2Fapi.2F0.6.2Fchangeset.2F.23id</a></div><div class=""><br class=""></div><div class=""><br class=""></div><br class=""><div><blockquote type="cite" class=""><div class="">On Jun 15, 2016, at 5:37 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 content="text/html; charset=utf-8" http-equiv="Content-Type" class="">
  
  <div bgcolor="#FFFFFF" text="#000000" class="">
    Net yet..hopefully soon.<br class="">
    <br class="">
    Sorry to be so persistent...but.. <br class="">
    I am still getting a 401 Unauthorized error when sending the
    changeset create request.<br class="">
    <br class="">
    Do I need to include the auth token in the header AJAX call? <br class="">
    <br class="">
    This is how I try to create a new changeset:<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://master.apis.dev.openstreetmap.org/api/0.6/changeset/create">"http://master.apis.dev.openstreetmap.org/api/0.6/changeset/create"</a>;<br class="">
    <br class="">
    $.ajax({<br class="">
        url: ajaxurl,<br class="">
        data: xml_new_changeset, <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="">
    <br class="">
    <div class="moz-signature"><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 class="moz-cite-prefix">On 15/06/2016 11:20, Christian
      Ledermann wrote:<br class="">
    </div>
    <blockquote cite="mid:CABCjzWqJh_Dx2vVamDu7RF+gm4j82ifWCo0XYmN-xe=FMYu-4Q@mail.gmail.com" type="cite" class="">
      <pre wrap="" class="">If you can read python have a look at:

<a class="moz-txt-link-freetext" href="https://github.com/cleder/osmoapi">https://github.com/cleder/osmoapi</a>

On 15 June 2016 at 09:57, Paul Norman <a class="moz-txt-link-rfc2396E" href="mailto:penorman@mac.com"><penorman@mac.com></a> wrote:
</pre>
      <blockquote type="cite" class="">
        <pre wrap="" class="">On 6/14/2016 8:41 AM, toni hernández wrote:

Hi everyone,

I am trying to display OSM data into my web map as well as other custom
layers.
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....

After authentificating with osmauth.js I try this code without any success.
I get a 401 error.

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>';

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>;


I do not recommend the node/create API endpoint. Instead, use the diff
upload API call documented at
<a class="moz-txt-link-freetext" href="http://wiki.openstreetmap.org/wiki/API_v0.6#Diff_upload:_POST_.2Fapi.2F0.6.2Fchangeset.2F.23id.2Fupload">http://wiki.openstreetmap.org/wiki/API_v0.6#Diff_upload:_POST_.2Fapi.2F0.6.2Fchangeset.2F.23id.2Fupload</a>.

You will have to use this endpoint anyways for modifying existing data.

_______________________________________________
dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:dev@openstreetmap.org">dev@openstreetmap.org</a>
<a class="moz-txt-link-freetext" href="https://lists.openstreetmap.org/listinfo/dev">https://lists.openstreetmap.org/listinfo/dev</a>

</pre>
      </blockquote>
      <pre wrap="" class="">

</pre>
    </blockquote>
    <br class="">
  </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>