HTTP 500 for items created through API.

We are creating content items though API and can see in the CX that the items have been created but when we try to open them we get an HTTP 500 error.

We are able to open and edit all other content items which were created through Content Explorer manually.

We have followed the general API for creating a component. Has anyone else faced such problem in the past? Is there some way to solve this?

Is there anything in the log other than a simple 500 error? It’s rather hard to pin down from the limited information you provide.

There are lots of customers who create items via the API, and these items are no different from items you create with the Content Editor.

Some things to check: make sure that your API program uses the correct Community and Locale, and that you are “checking in” or workflowing the content item after you save it (otherwise, it is checked out to the API program).

Dave,

We get " no rows returned for the result set ct_gsalinklist" error.

We did the following to create an item.

create an item
save the item and get the guid of the item
add slot entires to the item
save the item again

Before running the code, we have we have deleted older content items from the database tables directly. Could that be the reason?

Also, when we follow the above logic to create a content item and add 5 entires to the slot, we see that for every save we do we are creating a seperate content item, resulting in a total of 5 content items with the same data. But the content explorer only shows one content item. Is this normal behavior?

If you are creating 5 items (each with a separate content id) then there is something wrong with your code. Are you reloading the object after you save it, or just calling save with the same object repeatedly? (You should reload the object).

After you delete data directly from the database, I recommend that you run rxfix. This will clean up any orphaned data you may have created.