I have defined blogpost version number and blog post id which is coming as nested json in blogpost version endpoint as a composite key. However I saw that blogpost is coming as nested json sometimes but sometimes page is coming as a nested json , but in the composite key I have defined blogpost Id as primary key along with blogpost version number.
But whenever we are getting page as nested json instead of blogpost system is throwing null primary key error.
Now my question is why page nested json is coming under blogpost version that too we are passing page blogpost id in the endpoint. So just got confused, whether I have to treat this id as blogpost Id or page id.
I also verified the particular id which is coming in page nested json inside blogpost version endpoint response using below curl
curl --request GET \ --url 'https://{your-domain}/wiki/api/v2/pages/{id}' \ --user 'email@example.com:<api_token>' \ --header 'Accept: application/json'
But I ended up with 404 error, how ever same Id I have passed in below curl
curl --request GET \ --url 'https://{your-domain}/wiki/api/v2/blogposts/{id}' \ --user 'email@example.com:<api_token>' \ --header 'Accept: application/json'
I am able to fetch the records.
So its clearly saying that the id's which are coming under nested json of blogpost or page in the blogpost version endpoints are only related to blogpost, if this is true why I am getting page nested json in the blogpost version endpoint.
Questions:
1. page nested json is expected in blogpost version ?
2. if above point is true should I treat the details of that page nested json as page details ?
3. If above point is true, why I am not able to fetch the details of particular Id in page endpoint and why its working in blogpost endpoint.
Blogpost version curl :
curl --request GET \ --url 'https://{your-domain}/wiki/api/v2/blogposts/{id}/versions' \ --user 'email@example.com:<api_token>' \ --header 'Accept: application/json'
Response screenshot for reference: