Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const createContactByEmail = (sdataApiUrl: string, sdataUsername: string,
- sdataPassword: string, user: UserModelType): void => {
- axios.post(`${sdataApiUrl}/accounts`, {
- 'AccountName': user.lastName + ', ' + user.firstName,
- 'Contacts': {
- '$resources': [{
- 'Email': user.email,
- 'FirstName': user.firstName,
- 'LastName': user.lastName
- }]
- }
- }, {
- auth: {
- username: sdataUsername,
- password: sdataPassword
- },
- headers: {
- 'Content-Type': 'application/json',
- 'Accept': 'application/json'
- }
- }).then(function(response) {
- console.log('post success: ', response);
- }).catch(function(error) {
- console.log('post error: ', error);
- });
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement