# Submitting via curl or java to test - working examples?

**URL:** <https://community.crossref.org/t/submitting-via-curl-or-java-to-test-working-examples/1903>\
**Category:** Technical Support\
**Tags:** content-registration, deposit\_support, test\_admin\_tool\
**Created:** [19 July 2021 01:06 UTC](https://community.crossref.org/t/submitting-via-curl-or-java-to-test-working-examples/1903 "2021-07-19T01:06:02Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrphil](https://avatars.discourse-cdn.com/v4/letter/m/ecccb3/32.png) [@mrphil](https://community.crossref.org/u/mrphil)\
**Post date:** [19 July 2021 01:06 UTC](https://community.crossref.org/t/submitting-via-curl-or-java-to-test-working-examples/1903/1 "2021-07-19T01:06:02Z")

</div>

We are new to CrossRef and are trying to figure out how to submit our data.  
I managed to get xml that passes when I submit it via the test website, but I find a working example that submits via http post, which is our requirement.

I have tried the examples on the web pages:  
from: ([https://www.crossref.org/documentation/content-registration/direct-deposit-xml/https-post-using-java-program/](https://www.crossref.org/documentation/member-setup/direct-deposit-xml/https-post-using-java-program/))  
Java  
`java -jar crossref-upload-tool.jar --user myid mypwd --host test.crossref.org --metadata crtest.xml`

I have also tried the similar call from curl from [https://www.crossref.org/documentation/content-registration/direct-deposit-xml/https-post/](https://www.crossref.org/documentation/member-setup/direct-deposit-xml/https-post/)  
`curl -F 'operation=doMDUpload' -F 'login_id=myid' -F 'login_passwd=mypwd' -F 'fname=crtest.xml' https://test.crossref.org/servlet/deposit`

Both of them output the same thing, which appears to be a login webpage!

I can’t seem to get an answer from Crossref support, so for the moment our Crossref development has come to a standstil!

Here is the output from the `java` submission

```auto
2021-07-19 09:51:25.065+0900 INFO uploading to https://test.crossref.org:443/deposit/
2021-07-19 09:51:25.081+0900 INFO uploading submission: file=crtest.xml (doMDUpload)
2021-07-19 09:51:26.348+0900 INFO uploaded submission: file=crtest.xml

<!-- 

<br>
<font size=+1>

Welcome to Crossref.

</font>
<br><br>

<div id="browser-warning"></div>
<!--[if lt IE 9]>
    <style type="text/css">
        #browser-warning {
            display: none;
            background-color: #fde394;
            padding: 20px;
            max-width: 950px;
        }
        #browser-warning td.image {
        }
        #browser-warning img {
            max-height: 50px;
        }
        #browser-warning td.text {
            padding-left: 20px;
            padding-right: 20px;
            color: #4f5858;
            font-family: 'Open Sans', sans-serif;
            font-weight: bold;
        }
        #browser-warning .button {
            background-color: #3eb1c8;
            padding: 10px;
            text-decoration: none;
            border-radius: 4px;
            border: 0;
            color: #fefbef;
            font-family: 'Open Sans', sans-serif;
            font-weight: bold;
            line-height: 1;
            white-space: nowrap;
        }
    </style>
<table id="browser-warning-banner">
        <tr>
            <td class="image"><img src="/images/exclamation-triangle.gif"/></td>
            <td class="text"><span>Upgrade browser for full Crossref experience. It looks like you may be using an outdated web browser. Please update your browser for the best possible experience.</span></td>
            <td><a class="button" href="/supported-browsers.html" target="_blank" rel="noopener noreferrer">Supported Browsers</a></td>
        </tr>
    </table>
<![endif]--><!--
<br/>

<table border="0" cellpadding="0" cellspacing="0"><tr>

<td nowrap width="8" valign="top" class="tabSelected"><img src="/images/clips/top_left.gif" width="8" height="8" alt=""></td>
<td nowrap class="tabSelected"><a href="/servlet/useragent" title="" class="tabSelected">&nbsp;&nbsp;<b>Home</b>&nbsp;&nbsp;</a></td>
<td nowrap width="8" valign="top" class="tabSelected"><img src="/images/clips/top_right.gif" width="8" height="8" alt=""></td>

<td nowrap width="8" valign="top" class="tabNotAllowed"><img src="/images/clips/top_left.gif" width="8" height="8" alt=""></td>
<td nowrap class="tabNotAllowed"><a href="javascript:alert('You do not have permissions to access this function.')" title="Users: Not Accessible" class="tabNotAllowed">&nbsp;&nbsp;Users&nbsp;&nbsp;</a></td>
<td nowrap width="8" valign="top" class="tabNotAllowed"><img src="/images/clips/top_right.gif" width="8" height="8" alt=""></td>

<td nowrap width="8" valign="top" class="tabNotAllowed"><img src="/images/clips/top_left.gif" width="8" height="8" alt=""></td>
<td nowrap class="tabNotAllowed"><a href="javascript:alert('You do not have permissions to access this function.')" title="Submissions: Not Accessible" class="tabNotAllowed">&nbsp;&nbsp;Submissions&nbsp;&nbsp;</a></td>
<td nowrap width="8" valign="top" class="tabNotAllowed"><img src="/images/clips/top_right.gif" width="8" height="8" alt=""></td>

<td nowrap width="8" valign="top" class="tabNotAllowed"><img src="/images/clips/top_left.gif" width="8" height="8" alt=""></td>
<td nowrap class="tabNotAllowed"><a href="javascript:alert('You do not have permissions to access this function.')" title="Queries: Not Accessible" class="tabNotAllowed">&nbsp;&nbsp;Queries&nbsp;&nbsp;</a></td>
<td nowrap width="8" valign="top" class="tabNotAllowed"><img src="/images/clips/top_right.gif" width="8" height="8" alt=""></td>

<td nowrap width="8" valign="top" class="tabNotAllowed"><img src="/images/clips/top_left.gif" width="8" height="8" alt=""></td>
<td nowrap class="tabNotAllowed"><a href="javascript:alert('You do not have permissions to access this function.')" title="Reports: Not Accessible" class="tabNotAllowed">&nbsp;&nbsp;Reports&nbsp;&nbsp;</a></td>
<td nowrap width="8" valign="top" class="tabNotAllowed"><img src="/images/clips/top_right.gif" width="8" height="8" alt=""></td>

<td nowrap width="8" valign="top" class="tabNotAllowed"><img src="/images/clips/top_left.gif" width="8" height="8" alt=""></td>
<td nowrap class="tabNotAllowed"><a href="javascript:alert('You do not have permissions to access this function.')" title="Metadata Admin: Not Accessible" class="tabNotAllowed">&nbsp;&nbsp;Metadata Admin&nbsp;&nbsp;</a></td>
<td nowrap width="8" valign="top" class="tabNotAllowed"><img src="/images/clips/top_right.gif" width="8" height="8" alt=""></td>

</tr></table>

<table border="0" cellpadding="10" cellspacing="0" width="100%">
<tr><td width="100%" class="tabContent1">
<br>

-->

<!DOCTYPE html>
<html>
<head>
    <link rel=stylesheet href="https://test.crossref.org/css/tab.css" title="tab css">
    <link rel=stylesheet href="https://cdn.production.dcbridgecrossref.org/frontend/crossref-ui/2.1.1/crossref-ui.css" title="tab css">
    <link rel="shortcut icon" href="https://test.crossref.org/favicon.ico">
	<link href="https://cdn.jsdelivr.net/npm/@mdi/font@4.x/css/materialdesignicons.min.css" rel="stylesheet">
	<meta name="viewport" content="width=device-width, initial-scale=1, minimal-ui">
</head>
<!-- Matomo -->
<script type="text/x-template" id="template">
    <login-screen/>
</script>
<div id="app"></div>
<script type="text/javascript" src="https://cdn.production.dcbridgecrossref.org/frontend/crossref-ui/2.1.1/crossref-ui.umd.min.js"></script>
<script type="text/javascript">
var _paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(["setDocumentTitle", document.domain + "/" + document.title]);
_paq.push(["setCookieDomain", "*.apps.crossref.org"]);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="https://crossref.matomo.cloud/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '15']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
var parts = window.location.href.split("/");
var c = CrossrefUI.run({
  element: '#app',
  reset_password_url: 'https://authenticator.crossref.org/reset-password/',
  template: '#template',
  authApiBaseUrl: parts[0] + "//" + parts[2],
  apiPort: null,
  loginUrl: '/servlet/login',
  rolesUrl: '/servlet/login',
  authFieldSpec: {
    username: 'usr',
    password: 'pwd'
  },
  authPostDataFormat: 'formData',
  disableMirage: true
})
</script>
<noscript><p><img src="https://crossref.matomo.cloud/matomo.php?idsite=9&rec=1" style="border:0;" alt="" /></p></noscript>
<!-- End Matomo Code -->
<body>
</body>
</html>

```

---

<div class="post-metadata">

**Author:** ![pdavis](https://sea2.discourse-cdn.com/flex020/user_avatar/community.crossref.org/pdavis/32/981_2.png) [@pdavis](https://community.crossref.org/u/pdavis)\
**Post date:** [19 July 2021 13:04 UTC](https://community.crossref.org/t/submitting-via-curl-or-java-to-test-working-examples/1903/3 "2021-07-19T13:04:27Z")

</div>

Hello,

That looks like it could be because a test account has not been created for your username yet. Test accounts are not created by default and would need to be created by us upon request.

If you can email us at [support@crossref.org](mailto:support@crossref.org) with your prefix and username we will get one setup for you.

Thanks,  
Paul

---

<div class="post-metadata">

**Author:** ![mrphil](https://avatars.discourse-cdn.com/v4/letter/m/ecccb3/32.png) [@mrphil](https://community.crossref.org/u/mrphil)\
**Post date:** [20 July 2021 09:00 UTC](https://community.crossref.org/t/submitting-via-curl-or-java-to-test-working-examples/1903/6 "2021-07-20T09:00:01Z")

</div>

But I can use the same account from the [test.crossref.org](http://test.crossref.org) domain website and upload and test xml (I did say that in the question)

So what needs to be done then?

---

<div class="post-metadata">

**Author:** ![pdavis](https://sea2.discourse-cdn.com/flex020/user_avatar/community.crossref.org/pdavis/32/981_2.png) [@pdavis](https://community.crossref.org/u/pdavis)\
**Post date:** [20 July 2021 13:29 UTC](https://community.crossref.org/t/submitting-via-curl-or-java-to-test-working-examples/1903/7 "2021-07-20T13:29:09Z")

</div>

Hello,

Sorry, I missed that you had manually been able to login to the test account and deposit the file to us. Do you login to the test account using an email address and password or shared role credentials and password?

If you are using an email address then you would need to use the format `email@address.com/role` in the `login_id=` section.

Thanks,  
Paul

---

<div class="post-metadata">

**Author:** ![chartgerink](https://sea2.discourse-cdn.com/flex020/user_avatar/community.crossref.org/chartgerink/32/2528_2.png) [@chartgerink](https://community.crossref.org/u/chartgerink)\
**Post date:** [26 September 2021 12:01 UTC](https://community.crossref.org/t/submitting-via-curl-or-java-to-test-working-examples/1903/8 "2021-09-26T12:01:59Z")

</div>

FWIW the `curl` command works when you add the `@` sign in front of the filename - something which was not clear to me from the docs.

```auto
curl -F 'operation=doMDUpload' -F 'login_id=<EMAIL>/<ROLE>' -F 'login_passwd=<PASSWD>' -F 'fname=@<FILENAME>' https://test.crossref.org/servlet/deposit

```

Replace the `<VARIABLE>` bits.

---

<div class="post-metadata">

**Author:** ![pdavis](https://sea2.discourse-cdn.com/flex020/user_avatar/community.crossref.org/pdavis/32/981_2.png) [@pdavis](https://community.crossref.org/u/pdavis)\
**Post date:** [28 September 2021 10:50 UTC](https://community.crossref.org/t/submitting-via-curl-or-java-to-test-working-examples/1903/9 "2021-09-28T10:50:21Z")

</div>

Thanks @chartgerink for adding that tip. It is in the example in the documentation but not as clear as it should be so we will make some changes to that page. Thanks for alerting us to that.

---

<div class="post-metadata">

**Author:** ![ifarley](https://sea2.discourse-cdn.com/flex020/user_avatar/community.crossref.org/ifarley/32/44_2.png) [@ifarley](https://community.crossref.org/u/ifarley)\
**Post date:** [4 November 2021 02:23 UTC](https://community.crossref.org/t/submitting-via-curl-or-java-to-test-working-examples/1903/10 "2021-11-04T02:23:21Z")

</div>

Hi @chartgerink,

Thanks again for this suggestion. We have updated the documentation with a note in hopes that this clarifies this going forward. You can see the update here: [XML deposit using HTTPS POST - Crossref](https://www.crossref.org/documentation/member-setup/direct-deposit-xml/https-post/#00230)

My best,  
Isaac
