web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

How to insert data in Table " Contact (5050) " for external APP

(0) ShareShare
ReportReport
Posted on by 65

Hi,

I have a external Application , can i instert data in Contact (5050) Table outside of Business Central  ?

Thanks.

I have the same question (0)
  • Verified answer
    jdecottignies Profile Picture
    217 on at

    Hi,

    You can create a page of type API with source table as Customer, like this:

    page 50100 "API TestContact"
    {
        PageType = API;
        Caption = 'contact';
        APIPublisher = 'someApiPublisher';
        APIGroup = 'testapi';
        APIVersion = 'v1.0';
        EntityName = 'contact';
        EntitySetName = 'contacts';
        SourceTable = Contact;
        DelayedInsert = true;
    
        layout
        {
            area(Content)
            {
                repeater(GroupName)
                {
                    field(name; Name)
                    {
                        Caption = 'name';
                    }
                    field(address; Address)
                    {
                        Caption = 'address';
                    }
                }
            }
        }
    }

    Now if you want to insert in Contact you have to make an API Call to

    api.businesscentral.dynamics.com/.../someApiPublisher/testapi/v1.0/companies(<YourCompagnyID>)/contacts

    With POST Method and as a body:

    {
        "name": "someName",
        "address": "someAddress"
    }

    Bold words in url are defined in your Api Page Properties

    To retrieve <YourCompanyID> you must call Company/ endpoint before

    In Postman if you hit SEND with this configuration:

    pastedimage1579020761708v1.png

    it creates this contact

    pastedimage1579020793487v2.png

    Note that you cannot add a value to a field that does not exist on you page api object.

    If you want to post a contact and set his Phone Number, you'll have to add the "Phone No." field on your page

  • Armando Northware Profile Picture
    65 on at

    I do this but ..

    Postman return this :

    {

       "error": {

           "code": "RequestDataInvalid",

           "message": "Request data is invalid."

       }

    }

  • Armando Northware Profile Picture
    65 on at

    Do you need Authorization ?

  • Armando Northware Profile Picture
    65 on at

    I resolve this but i have another error , how to get de ID Company ?

    {

       "error": {

           "code": "BadRequest_NotFound",

           "message": "Bad Request - Error in query syntax.  CorrelationId:  5cb-994-65-85-6ec3b62de."

       }

    }

  • Armando Northware Profile Picture
    65 on at

    Thanks , I could already make the post

  • jdecottignies Profile Picture
    217 on at

    In Sandbox environment you can use Basic authentication:

    Username = Your BC UserName in your user card page

    Password = API Key field of your user card.

    For production you'll need OAUTH Authentication

  • Armando Northware Profile Picture
    65 on at

    Thanks .

    I could already make the post .

    but  i need UPDATE data in the same way , how to do this?

  • jdecottignies Profile Picture
    217 on at

    Did you try to use PATCH method instead of POST ?

  • Armando Northware Profile Picture
    65 on at

    No , but yo need in Contact the field "No." in  page extension you cant's use this column.

    "The name of field controls in pages of the type API must be alphanumeric.AL(AL0528) " o how to do the UPDATE

  • Armando Northware Profile Picture
    65 on at

    Im use PATCH method and return this :

    {

       "error": {

           "code": "BadRequest_MethodNotAllowed",

           "message": "'PATCH' requests for 'contacts' of EdmType 'Collection' are not allowed within Dynamics 365 Business Central OData web services.  CorrelationId:  f86724-94f-429-9829-d83853db."

       }

    }

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,344 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,742 Super User 2026 Season 1

#3
AndrewThomas81 Profile Picture

AndrewThomas81 1,231

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans