OJS 3.4.0-9 REST API problem

Hi,

I’m testing OJS 3.4.0-9 rest api but i don’t get all the data as seen in the rest api doc. result query example at: https://docs.pkp.sfu.ca/dev/api/ojs/3.4#tag/Submissions

For example, i get some data inside publication but i don’t get authors. I also tried using this endpoint:

/submissions/{submissionId}/publications

but it’s the same.. no authors.

Am i doing something wrong here?

Regards.

Hi @orcalator

You can get data via the /api/v1/submissions endpoint,author da is contained in the publications variable that returns the data."

Hi @deanting,

I did this, got some data like:

    0 => array:23 [▼
      "_href" => "https://somesite.com/index.php/somejournal/api/v1/submissions/31500/publications/29419"
      "authorsString" => "Joe Doe"
      "authorsStringIncludeInBrowse" => "Joe Doe"
      "authorsStringShort" => "Doe"
      "categoryIds" => []
      "coverImage" => array:2 [▶]
      "datePublished" => "2024-06-30"
      "doiObject" => array:6 [▶]
      "fullTitle" => array:2 [▶]
      "galleys" => array:1 [▶]
      "id" => 29419
      "locale" => "en"
      "pages" => "93-112"
      "prefix" => array:2 [▶]
      "primaryContactId" => 70998
      "pub-id::publisher-id" => null
      "sectionId" => 531
      "status" => 3
      "submissionId" => 31500
      "subtitle" => array:2 [▶]
      "title" => array:2 [▶]
      "urlPublished" => "https://somesite.com/index.php/somejournal/article/view/31500/version/29419"
      "version" => 1
    ]

but there are no authors. Maybe i’m doing something wrong.

Regards.

Hi @orcalator ,the key “authorsString“ is authors

Hi @deanting ,

I need all author metadata as shown in example found at: https://docs.pkp.sfu.ca/dev/api/ojs/3.4#tag/Submissions-Publications

"authors": [
  {
    "affiliation": {
      "en": "Filename",
      "fr_CA": "Nom de fichier"
    },
    "biography": {
      "en": "Filename",
      "fr_CA": "Nom de fichier"
    },
    "competingInterests": {
      "en": "Filename",
      "fr_CA": "Nom de fichier"
    },
    "country": "string",
    "email": "string",
    "familyName": {
      "en": "Filename",
      "fr_CA": "Nom de fichier"
    },
    "fullName": "string",
    "givenName": {
      "en": "Filename",
      "fr_CA": "Nom de fichier"
    },
    "id": 0,
    "includeInBrowse": true,
    "locale": "string",
    "orcid": "string",
    "preferredPublicName": {
      "en": "Filename",
      "fr_CA": "Nom de fichier"
    },
    "publicationId": 0,
    "seq": 0,
    "url": "string",
    "userGroupId": 0,
    "userGroupName": "string"
  }
]

Regards.

To get full publication object (not redacted version) - you can use endpoint for fetching individual publications.

index.php/publicknowledge/api/v1/submissions/{submissionId}/publications/{publicationId}

https://docs.pkp.sfu.ca/dev/api/ojs/3.4#tag/Submissions-Publications/paths/~1submissions~1{submissionId}~1publications~1{publicationId}/get

Hi @jardakotesovec ,

I tried this too but i got same (redacted version) :roll_eyes:

Regards.

Its important to specify publicationId in the url to get full object. I just did double check in 3.4 and I am getting full authors objects for example.

@jardakotesovec

I’ll try again and get back with findings. Thank you for help.

Regards.

@jardakotesovec ,

Yes, this works, thanks man, you helped me a lot. Maybe documentation for API should be more clear about this. Example for /submissions endpoint shows everything being returned but as we see, it’s not like that.

Regards.

@jardakotesovec ,

Btw. one more thing i noticed in documentation: https://docs.pkp.sfu.ca/dev/api/ojs/3.4#tag/Submissions/paths/~1submissions/get

For status it says:

Array of integers Items Enum: 1 3 4 5

Filter results by one or more submission statuses. Must match the value of one of the PKPSubmission::STATUS_QUEUED, PKPSubmission::STATUS_SCHEDULED, PKPSubmission::STATUS_PUBLISHED or PKPSubmission::STATUS_DECLINED constants.

so i suppose:

1 → STATUS_QUEUED
3 → STATUS_SCHEDULED
4 → STATUS_PUBLISHED
5 → STATUS_DECLINED 

however i noticed that STATUS_PUBLISHED equals 3, not 4. Is this some mistake since number 2 is missing?

Regards.