Jump to content

Recommended Posts

Posted

Hi All,

 

I know there are a few Bromcom API users on here. I'm very new to this.

 

I want to write back some data to Bromcom using a PowerApp. Specifically write to a UDF.

As per the screen shot, how do I identify the 'userDefinedFieldInstanceId' which I assume identifies the specific UDF. I thought it would be the name of the UDF, but it looks like it's expecting a number.

 

Assuming I can configure this data correctly, how do I then send this to the API. Do I use an invoke-webrequest, and if so, how do I know how to format it?

 

Apologies, if I'm asking stupid questions. I haven't found the api guidance particularly comprehensive.

 

 

 

api.jpg

Posted

It is a REST API so it accepts HTTP methods GET, POST and DELETE and data passed to the endpoint in the request body.  A very basic example using Powershell would be something like:

 

$uri = "https://api.bromcomcloud.com/UserDefinedFieldsData"

$body = @{
    applicationId            = "your_application_id"
    applicationSecret        = "your_application_secret"
    schoolId                 = 20001                            
    personId                 = 000
    userDefinedFieldInstanceId = 0 
    dataValue                = "Data for field"
}

try {
    $response = Invoke-RestMethod -Uri $uri -Method 'POST' -Body $body
    Write-Host "Success! Server Response:" -ForegroundColor Green
    $response | ConvertTo-Json
}
catch {
    Write-Host "API call failed. Error details:" -ForegroundColor Red
    $errorResponse = $_.Exception.Response.Content | ConvertFrom-Json
    $errorResponse | ConvertTo-Json
}

 

If you were given documentation for the previous SOAP API, you should have access to the Bromcom Test Instance/School that you can use for testing. If not, I'd request this from them as I would not recommend any development on live site at all and things could go bad very quickly.

 

The partner API is pretty good, but support is lacking a lot, asking a question is currently at 30 days with an open ticket..

  • Like 1
  • 2 weeks later...
Posted
On 02/07/2025 at 10:36, mitchell1981 said:

As per the screen shot, how do I identify the 'userDefinedFieldInstanceId' which I assume identifies the specific UDF. I thought it would be the name of the UDF, but it looks like it's expecting a number.



At a guess, do a GET on UserDefinedFieldInstanceOptions first...

image.thumb.png.fa120f5ed9abc2b603d0d0245744aba5.png

image.png.e57d496597f6abc19c8f1fe9eecd4b5a.png

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...