Failure of the action "SEND_HTTP request to_sharepoint" - The model could not resolve a type with the name "SP.Data.EventsListItem"

Anna Airapetian 1 Reputation point
2021-11-25T10:28:55.197+00:00

I'm accessing the SP list via the API:

method: POST
URI: _api/web/lists/getbytitle('Events')/items
Query text:
{
"__metadata": {
" "type": "SP.Data.EventsListItem"},
"EventDate": "2021-11-25",
"EndDate": "2021-11-25",
"Title": "Petrov",
"Description": "<b>Happy Birthday!<br/>"
}

Returns an error - The model could not resolve a type named "SP.Data.EventsListItem". If the model is available, then each type name must resolve to a valid type.

The name of the Events list. There is such a list on the website, I checked it. The articles indicate what to write without a dot - SP.Data.Events List Item. In Msdocs with a dot - SP.Data.Events.ListItem. And so and so I tried.

How can i fix this?

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,710 questions
Not Monitored
Not Monitored
Tag not monitored by Microsoft.
36,221 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. RaytheonXie_MSFT 31,606 Reputation points Microsoft Vendor
    2021-11-26T01:52:22.917+00:00

    Hi @Anna Airapetian
    There is something wrong in Query text. The type should be "SP.Data.EventsListItem". Please refer to following code

    {  
      "__metadata": {  
        "type": "SP.Data.EventsListItem"  
      },  
      "EventDate": "2021-11-25",  
      "EndDate": "2021-11-25",  
      "Title": "Petrov",  
      "Description": "<b>Happy Birthday!<br/>"  
    }  
    

    If you are confused about the content of "type". You can get items by _api/web/lists/getbytitle('Events')/items. You can get type as following
    152708-image.png


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



  2. Anna Airapetian 1 Reputation point
    2021-11-29T09:08:23.583+00:00

    but it doesn't work