User Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:devel:corebosws:methodreference [2021/02/27 00:29]
joebordes [Sync]
en:devel:corebosws:methodreference [2022/01/08 00:31] (current)
joebordes [Retrieve]
Line 70: Line 70:
  
 Get all the values the user has access to, of an existent record in the application. Given a web service ID of a record this service will return an array with all the fields and their values. Get all the values the user has access to, of an existent record in the application. Given a web service ID of a record this service will return an array with all the fields and their values.
 +
 +Note that the way coreBOS works is that you get the values in the format of the database but you must return them in the format of the user. There is a way to [[en:​devel:​corebosws:​skipconvertfields|inform coreBOS to accept values in database format]] and there is a Global Variable (**Webservice_Return_FormattedValues**) to retrieve values in the format of the user connected to the API.
  
 All reference type fields which are pointing to another record will have valid web service IDs. All reference type fields which are pointing to another record will have valid web service IDs.
Line 144: Line 146:
 ^Response:​|successfull| ^Response:​|successfull|
  
-Users have another ​additional ​endpoint which permits ​them to change their password.+Users have two other additional ​endpoints that permit ​them to change their password ​and Access Key.
  
 ^Method:​|changePassword| ^Method:​|changePassword|
Line 150: Line 152:
 ^Profile:​|changePassword(id:​string,​ oldPassword:​string,​ newPassword:​string,​ confirmPassword:​string):​string| ^Profile:​|changePassword(id:​string,​ oldPassword:​string,​ newPassword:​string,​ confirmPassword:​string):​string|
 ^Send as:|POST| ^Send as:|POST|
-^Parameters:​| => id: user web service ID \\ => typical password change parameters.+^Parameters:​| => id: user web service ID \\ => oldPassword \\ => newPassword \\ => confirmPassword
-^Response:|successfull|+^Response:​| ​=> permission error message \\ => success message with the new **Access Key**| 
 +^Comments:​|<​WRAP center round important 100%>​Note that the changePassword function will change also the Access Key of the user, so your next login will have to be with the new Access Key that is returned from the call. The new Access Key will only be visible in this response so be sure to save it.</​WRAP>​|
  
-<WRAP center round alert 80%> + 
-Note that the changePassword is only useful if using the Password option login method. The access key is changed when the password changes effectively blocking out the user if he connects with the access key method+^Method:​|changeAccessKey| 
-</WRAP>+^Purpose:​|Permits a user to change his Access Key or the Access Key of another ​user if the connected user is an administrator.| 
 +^Profile:​|changeAccessKey(id:​string):​string| 
 +^Send as:|POST| 
 +^Parameters:​| =id: user web service ID| 
 +^Response:| => permission error message \\ => success message with the new **Access Key**|
  
 ==== CRUD Documents ==== ==== CRUD Documents ====
Line 178: Line 185:
 Since network calls are very expensive we have added **mass operations** for the main actions. Since network calls are very expensive we have added **mass operations** for the main actions.
  
-=== MassCreate ===+=== MassCreate ​(MassUpsert) ​===
  
 ^Purpose:​|Create a set of records.| ^Purpose:​|Create a set of records.|
Line 317: Line 324:
  
 and you can see some more examples [[https://​github.com/​tsolucio/​coreBOSTests/​blob/​master/​include/​Webservices/​MassCreateTest.php|in the unit tests]]. and you can see some more examples [[https://​github.com/​tsolucio/​coreBOSTests/​blob/​master/​include/​Webservices/​MassCreateTest.php|in the unit tests]].
 +
 +**MassUpsert** The Mass create method can work also as a Mass Upsert method as it supports search and update functionality by means of the "​searchon"​ parameter which you can add to any record in the composite object entries that create accepts.
 +
 +The "​searchon"​ parameter is a comma-separated list of fields you want to search on. The method will search for equality on all given fields using the values in the "​elements"​ array. This is the exact same syntax you will find in the Upsert method below.
 +
 +You can [[https://​github.com/​tsolucio/​coreBOSTests/​blob/​master/​include/​Webservices/​MassCreateTest.php#​L203|find an example in the unit tests.]]
  
 === MassRetrieve === === MassRetrieve ===
Line 348: Line 361:
 ^Send as:|POST| ^Send as:|POST|
 ^Parameters:​| => context: an Object with the field-value pairs to validate. Either a "​module"​ or a "​record"​ entry must exist in the object. If "​record"​ is given the validations will be evaluated with the fields of the record.| ^Parameters:​| => context: an Object with the field-value pairs to validate. Either a "​module"​ or a "​record"​ entry must exist in the object. If "​record"​ is given the validations will be evaluated with the fields of the record.|
-^Response:​|true or false in the success field. If false is returned the result will contain an array wit all the validations that have failed|+^Response:​|true or false in the success field. If false is returned the result will contain an array with all the validations that have failed|
  
 Besides the ValidateInformation endpoint, we also have create and update options that are identical to their base counterparts explained above just that they will validate the values before executing any operation and return the error messages without taking any action if the validations do not pass. Besides the ValidateInformation endpoint, we also have create and update options that are identical to their base counterparts explained above just that they will validate the values before executing any operation and return the error messages without taking any action if the validations do not pass.
Line 380: Line 393:
 ^Method:​|**SetRelation**| ^Method:​|**SetRelation**|
 ^Purpose:​|Sets relations between one record and a set of other records.| ^Purpose:​|Sets relations between one record and a set of other records.|
-^Profile:​|SetRelation(relateThisId:​string, ​withTheseIds:Map):Map|+^Profile:​|SetRelation(relate_this_id:​string, ​with_these_ids:Map):Map|
 ^Send as:|POST| ^Send as:|POST|
-^Parameters:​| => relateThisId: web service ID of the main record to relate \\ => withTheseIds: array of web service IDs to relate to the main record|+^Parameters:​| => relate_this_id: web service ID of the main record to relate \\ => with_these_ids: array of web service IDs to relate to the main record|
 ^Response:| | ^Response:| |
 ^Examples:​|[[https://​github.com/​tsolucio/​coreBOSwsDevelopment/​blob/​master/​testcode/​424lib_setrelated.php|Development Tool]]| ^Examples:​|[[https://​github.com/​tsolucio/​coreBOSwsDevelopment/​blob/​master/​testcode/​424lib_setrelated.php|Development Tool]]|
Line 388: Line 401:
 ^Method:​|**UnsetRelation**| ^Method:​|**UnsetRelation**|
 ^Purpose:​|Deletes relations between one record and a set of other records.| ^Purpose:​|Deletes relations between one record and a set of other records.|
-^Profile:​|UnsetRelation(unrelateThisId:​string, ​withTheseIds:Map):Map|+^Profile:​|UnsetRelation(unrelate_this_id:​string, ​with_these_ids:Map):Map|
 ^Send as:|POST| ^Send as:|POST|
-^Parameters:​| => unrelateThisId: web service ID of the main record to unrelate \\ => withTheseIds: array of web service IDs to unrelate from the main record|+^Parameters:​| => unrelate_this_id: web service ID of the main record to unrelate \\ => with_these_ids: array of web service IDs to unrelate from the main record|
 ^Response:| | ^Response:| |
 ^Examples:​|[[https://​github.com/​tsolucio/​coreBOSwsDevelopment/​blob/​master/​testcode/​424lib_setrelated.php|Development Tool]]| ^Examples:​|[[https://​github.com/​tsolucio/​coreBOSwsDevelopment/​blob/​master/​testcode/​424lib_setrelated.php|Development Tool]]|