Submitting via curl or java to test - working examples?

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://0-www-crossref-org.libus.csd.mu.edu/documentation/content-registration/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://0-www-crossref-org.libus.csd.mu.edu/documentation/content-registration/direct-deposit-xml/https-post/
curl -F 'operation=doMDUpload' -F 'login_id=myid' -F 'login_passwd=mypwd' -F 'fname=crtest.xml' https://0-test-crossref-org.libus.csd.mu.edu/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

2021-07-19 09:51:25.065+0900 INFO uploading to https://0-test-crossref-org.libus.csd.mu.edu/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://0-test-crossref-org.libus.csd.mu.edu/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://0-test-crossref-org.libus.csd.mu.edu/favicon.ico">
	<link href="https://0-cdn-jsdelivr-net.libus.csd.mu.edu/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://0-authenticator-crossref-org.libus.csd.mu.edu/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>
1 Like

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 with your prefix and username we will get one setup for you.

Thanks,
Paul

1 Like

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

So what needs to be done then?

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

1 Like

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.

curl -F 'operation=doMDUpload' -F 'login_id=<EMAIL>/<ROLE>' -F 'login_passwd=<PASSWD>' -F 'fname=@<FILENAME>' https://0-test-crossref-org.libus.csd.mu.edu/servlet/deposit

Replace the <VARIABLE> bits.

2 Likes

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.

2 Likes

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

My best,
Isaac

1 Like