Hi,
I am trying to associate two items using Web API call, an N to N relationship exists between the tables.
The 1st entity has unique identifier as entity1id and entity2 has one as entity2id. Both these fields are text type.
The entity permissions are in place and site setting is also set for both the entities.
Still the API call fails with a 404 Not Found status code.
The ajax call I am using is:-
webapi.safeAjax({
type: 'POST',
url: '/_api/entity1('+entity1id +')/<relationshipname>/$ref',
contentType: 'application/json',
data: JSON.stringify({
'@odata.entity2id': '/entity2(' + entity2id + ')'
}),
success: function () {
console.log('success');
},
error: function () {
console.error('Error associating');
}