Is there any documentation on how to "fully" create a submission via REST API?

Using OJS 3.3.0.8

What I’d like to get is all the necessary steps (via REST API) to “Submit an Article” as in the “Submission Wizard”: 1. Start, 2. Upload Submission, 3. Enter Metadata, 4. Confirmation, 5. Next Steps.

Is this via REST API possible at all?

When creating a submission via Create a new submisssion the Submission is counted in the GUI (under Unassigned and under All Active) but it is not shown in the list.

What are the necessary steps to do it via REST API?

After “Create a new submission” I’ve tried Create a Publication. The documentation tells that
the path parameters publicationId and submissionId are required. But publicationId is not accepted.

# the path parameter "publicationId" returns an "api.404.endpointNotFound" error
$ curl -s \
>     -X POST \
>     "http://www.examle.com/index.php/ziaf/api/v1/submissions/${SUBMISSION_ID}/publications/1?apiToken=${API_TOKEN}" \
>     -H "Accept: application/json" \
>     -H "Content-Type: application/json"

{"error":"api.404.endpointNotFound","errorMessage":"The requested URL was not recognized."}

# the submission is there with no publication items
$ curl -s \
>     -X GET \
>     "http://www.example.com/index.php/ziaf/api/v1/submissions/${SUBMISSION_ID}/publications?apiToken=${API_TOKEN}"

{"itemsMax":0,"items":[]}

# requesting with POST we get a "<h1>404 Not Found</h1>"
$ curl -s \
>     -X POST \
>     "http://www.example.com/index.php/ziaf/api/v1/submissions/${SUBMISSION_ID}/publications?apiToken=${API_TOKEN}" \
>     -H "Accept: application/json" \
>     -H "Content-Type: application/json"

<h1>404 Not Found</h1>
1 Like

Faced same issue. Have anyone passed through this?

I also have the same problem.
It is not clear what API should be used to fully cover the submission/publication of an article.
Is there a tutorial, a white paper or anything to help?

I am currently running into the same issue. Have any of you found a solution?

Hi all,

Can anyone describe the problem in more details? I’m testing it locally and the POST request to the submissions endpoint works for me.
What your request and response looks like?

I can’t speak for the others in this thread, but I’d be happy to share the problems I’m running into while trying to figure this out. I’m keeping track of the progress I’m making, so hopefully I’ll be able to post a full guide if I do figure it out completely.

First off, I’m using OJS 3.3.0.7.

I’m running into two of the problems in this thread:

  1. When creating a submission, it does not show up in the GUI. I can request the information through the API, edit it etc, but nothing is seen in the interface. What I do get is these whitespaces (which I’m assuming might be related, but might not be):

  2. I’ve not yet figured out how to add a publication to a submission. The create a publication specifies that a publicationID should be added, but not where in the path, nor how you should get one for a publication that does not exist yet.

When posting to /submissions/{{submissionID}}/publications (e.g. without an publicationID) I get a 404-not found.

When posting with an arbitrary publicationID, I get a 403 with the message The requested URL was not recognized.

I can edit existing publications through the API quite easily, and the changes show up in the API as well. I’ll keep looking into it, but any help anyone can give would be welcome.

What is the response? Do you see something like

{
    "_href": "http://localhost:8000/index.php/publicknowledge/api/v1/submissions/27",
    "commentsForTheEditors": null,
    "contextId": 1,
    "currentPublicationId": 28,
    "dateLastActivity": "2023-08-31 13:52:46",
    "dateSubmitted": "2023-08-31 13:52:46",
    "id": 27,
    "lastModified": "2023-08-31 13:52:46",
    "locale": "en",
    "publications": [
        {
            "_href": "http://localhost:8000/index.php/publicknowledge/api/v1/submissions/27/publications/28",
            "authorsString": "",
            "authorsStringIncludeInBrowse": "",
            "authorsStringShort": "",
            "categoryIds": [],
            "coverImage": {
                "en": null,
                "fr_CA": null
            },
            "datePublished": null,
            "doiObject": null,
            "fullTitle": {
                "en": "",
                "fr_CA": ""
            },
            "galleys": [],
            "id": 28,
            "locale": "en",
            "pages": null,
            "prefix": {
                "en": "",
                "fr_CA": ""
            },
            "primaryContactId": null,
            "pub-id::publisher-id": null,
            "sectionId": 1,
            "status": 1,
            "submissionId": 27,
            "subtitle": {
                "en": "",
                "fr_CA": ""
            },
            "title": {
                "en": "",
                "fr_CA": ""
            },
            "urlPublished": "http://localhost:8000/index.php/publicknowledge/article/view/27/version/28",
            "version": 1
        }
    ],
    "reviewAssignments": [],
    "reviewRounds": [],
    "stageId": 1,
    "stages": [
        {
            "id": 1,
            "label": "Submission",
            "isActiveStage": true,
            "openQueryCount": 0,
            "currentUserAssignedRoles": [],
            "statusId": 1,
            "status": "No editor has been assigned to this submission.",
            "files": {
                "count": 0
            }
        },
        {
            "id": 3,
            "label": "Review",
            "isActiveStage": false,
            "openQueryCount": 0,
            "currentUserAssignedRoles": [],
            "files": {
                "count": 0
            }
        },
        {
            "id": 4,
            "label": "Copyediting",
            "isActiveStage": false,
            "openQueryCount": 0,
            "currentUserAssignedRoles": [],
            "files": {
                "count": 0
            }
        },
        {
            "id": 5,
            "label": "Production",
            "isActiveStage": false,
            "openQueryCount": 0,
            "currentUserAssignedRoles": [],
            "files": {
                "count": 0
            }
        }
    ],
    "status": 1,
    "statusLabel": "Queued",
    "submissionProgress": "start",
    "urlAuthorWorkflow": "http://localhost:8000/index.php/publicknowledge/authorDashboard/submission/27",
    "urlEditorialWorkflow": "http://localhost:8000/index.php/publicknowledge/workflow/access/27",
    "urlPublished": "http://localhost:8000/index.php/publicknowledge/article/view/27",
    "urlSubmissionWizard": "http://localhost:8000/index.php/publicknowledge/submission?id=27",
    "urlWorkflow": "http://localhost:8000/index.php/publicknowledge/submission?id=27"
}

To what specific request would that be a potential response?

To the calls described above that give me error messages, I don’t get that response.

Posting to {{baseURL}}/submissions/{{submissionID}}/publications results in <h1>404 Not Found</h1>

Posting to {{baseURL}}/submissions/{{submissionID}}/publications/14532 or any other arbitrary publication ID, I get

{
    "error": "api.404.endpointNotFound",
    "errorMessage": "The requested URL was not recognized."
}

Which is not surprising.

If you’re refering to the first question about creating a submission, I get this response:

{
    "_href": "https://testplatform.openjournals.nl/IISG/api/v1/submissions/12523",
    "contextId": 29,
    "currentPublicationId": 0,
    "dateLastActivity": "2023-09-01 09:23:53",
    "dateSubmitted": "2023-08-23 00:00:00",
    "id": 12523,
    "lastModified": "2023-09-01 09:23:53",
    "locale": "en_US",
    "publications": [],
    "reviewAssignments": [],
    "reviewRounds": [],
    "stageId": 1,
    "stages": [
        {
            "id": 1,
            "label": "Submission",
            "isActiveStage": true,
            "queries": [],
            "currentUserAssignedRoles": [],
            "statusId": 1,
            "status": "No editor has been assigned to this submission.",
            "files": {
                "count": 0
            }
        },
        {
            "id": 3,
            "label": "Review",
            "isActiveStage": false,
            "queries": [],
            "currentUserAssignedRoles": [],
            "files": {
                "count": 0
            }
        },
        {
            "id": 4,
            "label": "Copyediting",
            "isActiveStage": false,
            "queries": [],
            "currentUserAssignedRoles": [],
            "files": {
                "count": 0
            }
        },
        {
            "id": 5,
            "label": "Production",
            "isActiveStage": false,
            "queries": [],
            "currentUserAssignedRoles": [],
            "files": {
                "count": 0
            }
        }
    ],
    "status": 1,
    "statusLabel": "Queued",
    "submissionProgress": 0,
    "urlAuthorWorkflow": "https://testplatform.openjournals.nl/IISG/authorDashboard/submission/12523",
    "urlEditorialWorkflow": "https://testplatform.openjournals.nl/IISG/workflow/access/12523",
    "urlPublished": "https://testplatform.openjournals.nl/IISG/article/view/12523",
    "urlWorkflow": "https://testplatform.openjournals.nl/IISG/workflow/access/12523"
}

Yes, it looks that you are right. Creating a new submission in OJS 3.3 doesn’t create new publication. That API endpoint was rewritten in 3.4 with the introduction of the new submission wizard

That sounds like a bug. I’ve opened an issue: Unable to create a new publication through submission API · Issue #9275 · pkp/pkp-lib · GitHub

Thank you for your answer. In that case, I’ll put this on hold until we’ve upgraded to 3.4, as it does not seem possible in 3.3.