Home Forums Traccar API PHP Integration assignUserGeofence

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #219
    José FelizbertoJosé Felizberto

    Hello James,

    I am trying to create a new method called “assignUserGeofence” in “traccar Api-1.1.php” , but, unfortunately it is NOT working:

    public static function assignUserGeofence($sessionId,$userId,$geofenceId){
    return self::curl(‘/api/permissions’,’POST’,$sessionId,$data,array(self::$jsonC));

    Can you help-me?


    José FelizbertoJosé Felizberto

    I am recivining this erro:

    Codigo erro: 400
    Cannot add or update a child row: a foreign key constraint fails (traccaroficial.tc_user_geofence, CONSTRAINT fk_user_geofence_geofenceid FOREIGN KEY (geofenceid) REFERENCES tc_geofences (id) ON DELETE CASCADE) – SQLIntegrityConstraintViolationException (… < QueryBuilder:480 < DataManager:441 < PermissionsResource:63 < …)

    Help please

    James JosephJames


    What database are you using? and has anything been changed in the database or any customizations done?

    Based on the error, it is something to do with the database.

    José FelizbertoJosé Felizberto

    Thank you. I will do double check in MySQL database.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.