<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p><br>
    </p>
    And please (please please please) -do- check existing data before
    you upload.<br>
    <br>
    <div class="moz-cite-prefix">Am 14.06.2016 um 18:31 schrieb Ian
      Dees:<br>
    </div>
    <blockquote
cite="mid:CAG91b3R4zLE8RWyLsWtbmX2fGeguT1TgGLgLQy5Lg19HG4e+uQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">Also, don't forget to use the dev server to do your
        testing so you don't accidentally create bad data in the real
        database. The URL is <a moz-do-not-send="true"
          href="http://master.apis.dev.openstreetmap.org/">http://master.apis.dev.openstreetmap.org/</a>.</div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr">On Tue, Jun 14, 2016 at 12:13 PM Bryan Housel
          <<a moz-do-not-send="true"
            href="mailto:bryan@7thposition.com">bryan@7thposition.com</a>>
          wrote:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex">
          <div style="word-wrap:break-word">
            <div>You can’t just pass “0” as the changeset id.</div>
            <div><br>
            </div>
            <div>Your app will need to create a changeset first with :</div>
            <div><a moz-do-not-send="true"
href="http://wiki.openstreetmap.org/wiki/API_v0.6#Create:_PUT_.2Fapi.2F0.6.2Fchangeset.2Fcreate"
                target="_blank">http://wiki.openstreetmap.org/wiki/API_v0.6#Create:_PUT_.2Fapi.2F0.6.2Fchangeset.2Fcreate</a></div>
            <div><br>
            </div>
            <div>This diagram talks a bit about the flow of how to
              create a changeset, issue updates against it, then close
              the changeset:</div>
            <div><a moz-do-not-send="true"
href="http://wiki.openstreetmap.org/wiki/File:OSM_API0.6_Changeset_successful_creation_V0.1.png"
                target="_blank">http://wiki.openstreetmap.org/wiki/File:OSM_API0.6_Changeset_successful_creation_V0.1.png</a></div>
          </div>
          <div style="word-wrap:break-word">
            <div><br>
            </div>
            <div><br>
            </div>
            <div><br>
            </div>
            <br>
            <div>
              <blockquote type="cite">
                <div>On Jun 14, 2016, at 11:41 AM, toni hernández <<a
                    moz-do-not-send="true"
                    href="mailto:toni@sigte.udg.edu" target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:toni@sigte.udg.edu">toni@sigte.udg.edu</a></a>>
                  wrote:</div>
                <br>
                <div>
                  <div bgcolor="#FFFFFF" text="#000000"> Hi everyone,<br>
                    <br>
                    I am trying to display OSM data into my web map as
                    well as other custom layers.<br>
                    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 moz-do-not-send="true"
                      href="http://wiki.openstreetmap.org/wiki/API_v0.6#Elements"
                      target="_blank">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>
                    <br>
                    After authentificating with osmauth.js I try this
                    code without any success. I get a 401 error.<br>
                    <br>
                    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>
                    <br>
                    ajaxurl= <a moz-do-not-send="true"
                      href="http://www.openstreetmap.org/api/0.6/node/create"
                      target="_blank">"http://www.openstreetmap.org/api/0.6/node/create"</a>;<br>
                    <br>
                    $.ajax({<br>
                        url: ajaxurl,<br>
                        data: xml_string, <br>
                        type: 'PUT',<br>
                        contentType: "text/xml",<br>
                        dataType: "text",<br>
                        success : function (resp){console.debug(resp)},<br>
                        error : function (xhr, ajaxOptions,
                    thrownError){  <br>
                            console.log(xhr.status);          <br>
                            console.log(thrownError);<br>
                        } <br>
                    });        <br>
                    <br>
                    Do I need to include oauth_secret and
                    oauth_consumer_key from the authentification
                    proccess in the ajax request?<br>
                    <br>
                    Any help will be really apreciated.<br>
                    Thanks <br>
                    <div>-- <br>
                      <span style="font-size:8.5pt"> <b>Toni Hernández
                          Vallès</b> <br>
                        Servei de Sistemes d'Informació Geogràfica i
                        Teledetecció<br>
                        -<br>
                        Universitat de Girona<br>
                        <b>SIGTE</b><br>
                        -<br>
                        Pl. Ferrater Mora 1<br>
                        17071 Girona<br>
                        Tel +34 972 418 039 (7026 intern)<br>
                        <a moz-do-not-send="true"
                          href="mailto:toni@sigte.udg.edu"
                          target="_blank">toni@sigte.udg.edu</a> <br>
                        <br>
                        <a moz-do-not-send="true"
                          href="http://www.sigte.udg.edu/"
                          target="_blank">http://www.sigte.udg.edu</a><br>
                        Twitter <a moz-do-not-send="true"
                          href="http://twitter.com/SIGTE_UDG"
                          target="_blank">http://twitter.com/SIGTE_UDG</a><br>
                        <br>
                      </span></div>
                  </div>
                  _______________________________________________<br>
                  dev mailing list<br>
                  <a moz-do-not-send="true"
                    href="mailto:dev@openstreetmap.org" target="_blank">dev@openstreetmap.org</a><br>
                  <a moz-do-not-send="true"
                    href="https://lists.openstreetmap.org/listinfo/dev"
                    target="_blank">https://lists.openstreetmap.org/listinfo/dev</a><br>
                </div>
              </blockquote>
            </div>
            <br>
          </div>
          _______________________________________________<br>
          dev mailing list<br>
          <a moz-do-not-send="true" href="mailto:dev@openstreetmap.org"
            target="_blank">dev@openstreetmap.org</a><br>
          <a moz-do-not-send="true"
            href="https://lists.openstreetmap.org/listinfo/dev"
            rel="noreferrer" target="_blank">https://lists.openstreetmap.org/listinfo/dev</a><br>
        </blockquote>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
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>
    <br>
  </body>
</html>