Unable to edit publication date using API (OJS 3.3.0.13)

I’m trying to edit the publications dates for a journal’s back issues (born-print journal, the publication dates currently show the ingest date instead of the original publication date). However, I can’t get the publication dates to update and save.

Right now I’m just working on a single article as proof of concept before running a batch operation.

The workflow I’m using is:

  1. unpublish the publication,
  2. edit the publication,
  3. publish the publication.

Here’s the Python code I’m using for the respective steps:

  1. requests.put(unpub_endpoint,params={'apiToken':key})
  2. requests.put(edit_endpoint,params={'apiToken':key,'datePublished':'1967-06-02'})
  3. requests.put(pub_endpoint,params={'apiToken':key})

I get 200 codes in response to each of those queries. I’ve triple-checked the submission and publication IDs in the URL path. Using the web-based dashboard, the Activity Log for the submission shows that the submission was unpublished, that the metadata was updated, and that the submission was published. However, the publication date still shows “2017-05-03.”

Am I using the API incorrectly, or is this a problem with the API? I’d really rather not create a new version of each article since it’s a metadata problem and not an article version problem. I’m also concerned about having a second version of the article published with a publication date 60 years prior to the first, and whatever unforseen consequences that may have.

Thanks in advance!

Addendum: I continued to experiment with edit requests using the API on my OJS sandbox and continue to run into problems where I get a 200 response code but the answer do not seem to save.

I was able to successfully create a new version of a publication. However, when I tried to edit either datePublished or pages before publishing the new version, I continued to receive 200 response codes without successfully changing either metadata field.

Ugh nope, I’m the dummy: I was trying to pass the argument as a parameter. The code to edit should have been requests.put(edit_endpoint,params={'apiToken':key}, data={'datePublished':'1967-06-02'})

1 Like

This topic was automatically closed after 8 days. New replies are no longer allowed.