How to use CMServiceAPI to connect and save the document to CM23

Is there anyone to provide the User Guide how to use CMServiceAPI ? Thank

Parents
  • 0

    Hi There, 

    Depending on how the ServiceAPI was configured during installation, it comes with with a Help Index and a Swagger interface. 

    http://<ServerName>/CMServiceAPI/help/index

    http://<ServerName>/CMServiceAPI/swagger-ui/

    Some knowledge of your Content Manager instance will be required to assist with structuring of the payload to meet any CM requirements for capturing documents into the system. 

  • 0   in reply to 

    In the built in self-hosted documentation under 'Samples' (a bit down on the landing page) there should be one for 'Create a Record from a document'

    To see the payload you should be able to open up the network monitor using your web browsers dev tools to look how the payload was crafted to suit your particular dataset.

    -Scotty

  • 0 in reply to   

    Thank Scotty. Through http://<ServerName>/CMServiceAPI/swagger-ui/  I got the following much information. Where can I get the User Guide how to use each URLS (Post, GET, PUT, PATCH and Delete) For example, how to get the record type, unique identifier, container, classification and so on and how to inject the document into CM23

Reply
  • 0 in reply to   

    Thank Scotty. Through http://<ServerName>/CMServiceAPI/swagger-ui/  I got the following much information. Where can I get the User Guide how to use each URLS (Post, GET, PUT, PATCH and Delete) For example, how to get the record type, unique identifier, container, classification and so on and how to inject the document into CM23

Children
  • Verified Answer

    +1   in reply to 

    Each object type has its own endpoint

    So there is a:

    CMServiceAPI/Record/

    CMServiceAPI/RecordType/

    CMServiceAPI/Classification/

    If you expand out any of the endpoints listed in /swagger-ui/ it will then list out what a GET and a POST is typically used for, along with parameters that you can pass in for each. 

    This is where knowledge of your own dataset will come in, as the URI's sent as part of a payload will need to match your own record types.

    Typically the GET endpoints are used for retrievals 'Searches' and the POST endpoints are used for creation and updating. There isn't a PUT / PATCH / DELETE.

    As the swagger documentation is extremely verbose, I recommend browsing through the samples on the landing page as there are 60 pre-built samples that use JS to pull data from your dataset to show how GET or POST payloads should appear.

    localhost/.../index

    -Scotty