You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

BUI: Update contact

Accepted answer
30
Views
7
Comments
edited Sep 18, 2018 1:39PM in UI Extensibility 7 comments

Summary

Rest api in Ajax not working

Content

Hi All,

I am using below code to update contact record in Ajax using Rest API

function updateContactRecord(sessionToken,ExContactID,email,fname,lname,custid){
                return $.ajax({
                      url: globalContext.getInterfaceServiceUrl('rest')+'/connect/v1.3/contacts/'+ ExContactID,
                      method: "POST",
                      headers:{'Authorization':'Session '+sessionToken,'X-HTTP-Method-Override': 'PATCH'},
                      data: JSON.stringify({
                                            name : {
                                                first: fname,
                                                last: lname
                                            },                                            
                                            customFields:{
                                                c:{
                                                customerid:    custid
                                                }
                                            }        
                                        }),
                      dataType: "json"
                    });
            }

 

But it is not working, anybody help me

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!