Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Web Api - Service Appointment - Customer Field

Posted on by

I am trying to use the WebAPi (V8.1) to create a service activity with a customer but unable to make this work.

I've tried adding as an activity party and as a 'contact' direct but keep getting 'Bad Request' error.

Is there a known issue with adding a 'Customer' to the service activity via the Web Api?

Thanks

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Web Api - Service Appointment - Customer Field

    You can try to replace “customers_activity_parties” with "serviceappointment_activity_parties"


    Hope this helps

    Vlad

    http://dynamicalabs.com/

  • CRmQuestions Profile Picture
    CRmQuestions on at
    RE: Web Api - Service Appointment - Customer Field

    This works:

    {
    	"scheduledstart": "2017-12-22T14:15:00Z",
    	"scheduledend": "2017-12-22T14:30:00Z",
    	"subject": "Test Service activity via Web API",
    	"serviceid@odata.bind": "/services(4871A000-1C45-E711-8106-5065F38B9581)",
    	"regardingobjectid_contact@odata.bind": "/contacts(70033000-0CB5-E411-9A6F-005056866E77)"
    }
    


    This does not work:

    {
    	"scheduledstart": "2017-12-22T14:15:00Z",
    	"scheduledend": "2017-12-22T14:30:00Z",
    	"subject": "Test Service activity via Web API",
    	"serviceid@odata.bind": "/services(48710000-1C45-E711-8106-5065F38B9581)",
    	"customers_activity_parties": [
    		{
    			"partyid_contact@odata.bind": "/contacts(70033EB0-0CB5-E411-9A6F-005056866E77)",
    			"participationtypemask": 1
    		}
    	],
    	"regardingobjectid_contact@odata.bind": "/contacts(70030000-0CB5-E411-9A6F-005056866E77)"
    }
    


    Nor does just adding the below work instead of Activity parties.

    ["customers@odata.bind"] = "/contacts(70030000-0CB5-E411-9A6F-005056866E77)"

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Web Api - Service Appointment - Customer Field

    Hi,
     
    Can you please provide the code for your request?
     
    It is possible that your request has not been created correctly.
     
    Hope this helps

    Vlad

    http://dynamicalabs.com/

  • CRmQuestions Profile Picture
    CRmQuestions on at
    RE: Web Api - Service Appointment - Customer Field

    Hi,

    Yep - Did try that. 

    Interestingly enough, even when retrieving one record the customer field is not returned via the RestBuilder which makes me think is this is known issue with V8.1 of the API?

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Web Api - Service Appointment - Customer Field

    Hi,

    did you try to check you request with the CRMRestBuilder? github.com/.../CRMRESTBuilder

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans