Forum Discussion

radhika_kundana's avatar
3 years ago

Join node/group 301 API error

Hi,

I was able to implement Leave node successfully using membership API(Javascript).

But Join node API is returning 301 error and I don't see error details, can we see actual error details to find the issue? 

Code:  I am calling below function on button click. 

function joinNode()
{
const options = {
method: 'POST',
headers: {Accept: 'application/json', 'Content-Type': 'application/json'}
};
console.log(options);
fetch('https://lithium.com/api/2.0/nodes/grouphub:'+ groupID + '/membership_requests', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));

}

Error details from console: 

 POST https://lithium.com/api/2.0/nodes/grouphub:MexicoPowerApps/membership_requests   500

{status: 'error', message: 'An unexpected error occurred.', data: {…}, metadata: {…}} data:code: 301

developer_message: ""

more_info: ""

type: "error_data"

[[Prototype]]: Object

message: "An unexpected error occurred."

metadata: {}

status: "error"

[[Prototype]]: Object

2 Replies