SugarCRM api (Rest Webservice call) for Database Schema - rest

I am looking SugarCRM API (Rest Webservice call) for Database Schema.
Where can I get details of all the tables, entities, Column names, relationship available in SugarCRM?
I want to get Metadata. I have API's for CRUD operations but I want to find schema API.

Here is a list of available API calls for SugarCRM 7.
http://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_7.5/API/Web_Services/Examples/v10/index.html.
Here is a link for the database scheme.
http://apidocs.sugarcrm.com/schema/7.6.1.0/ent/
As far as I know there isn't a schema API. To get all fields (core and custom) for a module you'd have to query 1 record to retrieve the fields list.

I have found one API for retrieving schema.
Using this URL " {site url}/rest/v10/metadata"
we can get schema for all the tables available in SugarCRM in one shot.

Related

public ids in relationships for REST API

I'm building a REST API, some of the resources have relationship between them. What are pro and cons of exposing database ids? One that comes to mind is that if their are auto increment you can expose some unwanted data (if number x exist, then there could have existed also x-1)
I googled extensively for best practices in this scenario but didn't really find out a reference guide.
Should ids (of records or of relationships) be exposed? If not, what is the current standard format for public ids? uuid4? The setup uses ORM to abstract the database, but if that helps it may end up being postgre in production.
Thanks

Oracle Apex: RESTful Webservice not working after change of database schema

I'm currently using APEX 18.1 and we created in our first database schema (db1) a RESTful Webservice (we provide a URL so other Application can send us data, so that we save them in the database). Now I changed the schema, to a new one (db2) and also already changed that in the shared components.
But the data is still saving in the old schema and I dont know how I change the schema for the REST services. I already tried to put the schema name in front of my statements like "INSERT INTO "db2".test VALUES (xyz) but its not working.
Does someone have the same problem and a solution ?

FOSElastica + FosRest + Doctrine + REST Api

Versions
Symfony 2.8.2
FosElastica 3.1.8
FosRest 1.7.7
Doctrine 2.5.4
Problem
Hello,
I have some MYSQL's tables with many relations. I would like a build a REST Api, in HTMl a JSON, to get them.
It is working in HTML, but doesn't in JSON.
Indeed, in JSON I am returning array with multi dimensional, and doctrine made each request to get data.
This maneuver makes many times and fail.
The solution will be to make a SQL join with the return of ElasticSearch but I don't how to make that.
Any idea?
The better solution is to make a REST API.
REST API never reterning a deep JSON Object, but only the asked object.
For instance one Entity People containing a list of Cars.
You have to make routing something like that :
Returning all users as light object (only id ans very important informations) :
/users
Returning one Full User WITHOUT his cars :
/users/{userId}
Returning full list if cars (as light objects) :
/users/{userId}/cars
Returning full car object (without sub object obviously) :
/users/{userId}/cars/{carId}
After you can manage your routing as you want with RESTFull

Where do you create a custom model (DTO) in server code, such that Breeze can relate to EntityFramework entities?

I am developing a SPA using Angular-Breeze-WebAPI-EntityFramework.
Now Breeze uses the Entity Framework metadata information to create it's own Breeze models. We use this in our application for Breeze validation.
So far, it's all been nice and easy. Now we are having to create a search page (say for querying customers). The search can be by Customer.Name or by Product.Id (which would return a list of customers who have bought that product). The result is a ng-repeater, which displays Customer.Name, Order.LastPlaced etc.
if you are getting confused by the tables and columns, forget that. What I am only trying to get to is that, both the search object and the result object are not 1:1 with Entity tables (or objects). So obviously I feel the need to create a custom object (one for the search and one for the results). My question primarily is where and how do I create that object?
If I create it at the data layer, Breeze would have no idea of the metadata for each of the properties (since it uses EF for that).
I obviously can't create just a JavaScript object, since I will have to query the database (using EF) to search and populate the object.
So where does one create such a custom object (traversing multiple tables) such that Breeze still can figure out the metadata and perform validation and such when the need arises?
Thank you all.
You can create metadata on the client for types that the server either doesn't know about or doesn't have the schema for. See http://www.breezejs.com/documentation/metadata-by-hand.

Dynamics 2011 Intersect / Junction entity

I have 3 entities.
PortalRole, Person and PersonPortalRole
PersonPortalRole is a intersection entity to deal with my Many-Many relationship.
I am using JavaScript through a HTML web resource to allow the creation and removal of this entity. I can create new entities by using the REST service fairly easily but I can't find a way of deleting a intersect record (two lookup fields) using the PersonId and PortalRoleId.
Has anyone had any exposure to either deleting a record through REST using the two foreign keys values from a lookup? I was trying to get the object first using a filter but can't seemt o filter using the lookup primary keys.
Was trying something like below which returns 15 entries to then filter the results to get the primary key, and then delete using that key but not sure on the way to do this.
SERVER/INSTANCE/XRMServices/2011/OrganizationData.svc/personportalrolesSet?$expand=Person,PortalRole
Based on that URI, you are interacting with an OData service. OData uses Atom feeds for returning lists of stuff so you will likely find within each <entry> element a <id> element that contains the URL of the resource. If you issue a HTTP DELETE to that URL then your resource will be deleted.
See docs here http://www.odata.org/developers/protocols/operations#DeletingEntries
I don't use the REST endpoint, but there's no way I know of to end a many-to-many relationship except through sending a Disassociate request (or if you have access to the SQL box, direct insertion/deletion in that table). MS has some sample code available that shows how to do this using the REST Endpoint.