API Basics
Structure
6 min
at cross river, we have a robust set of apis spanning our suite of products to access our apis and try them out in our sandbox, contact integration support to get started our apis are organized around rest, have object oriented urls, accept form encoded request bodies, return json encoded responses, and use standard http response codes, authentication, and methods when you call an api, you've sent a request the answer you receive back is the response resource/object a resource (object) is the category of information that you want to receive information for, via api for example, in our p2c product, a card and a transaction are resources, and in our lending product, a loan is a resource endpoints and methods an endpoint is the url address of an api that you want to retrieve you can retrieve an endpoint by using a method the method is the prefix you add to your endpoint to send the relevant api request they are prefix description get a get request retrieves resource information a get request never has a body post a post request adds or creates a resource put a put request updates or fixes resource information delete a delete request deletes or cancels a resource patch a patch request updates or fixes a smaller scope of resource information parameters there are 3 types of parameters path a path parameter can be added to a url endpoint to return a specific response the path parameter is added to the url in curly brackets ( { } ) and follows a backslash ( / ) for example, if you want to retrieve specific information on an account, you can add /{accountnumber} to the url when your api includes curly brackets, a path parameter is required body body parameters are the data included in the body of an api, and the information they represent can be changed the body of the request and response messages are called payloads query a query parameter narrows down and filters the results of your request based on the information you are requesting the query parameter is added to the url and follows a question mark ( ? ) only get calls use query parameters request headers a request header is an http header used in a request that provides information about the request context it let's the server tailor the response in our documentation requests are presented in curl true falsefalse unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type false unhandled content type curl location request get 'https //cr sandbox domain/{xxx} \ header 'accept application/json' \ header 'authorization {bearer token}' 'https //cr sandbox domain/' request id for every request, the response header contains a requst id value this unique identifier is used by the cross river support team for troubleshooting we strongly recommend you save this identifier next steps when you're ready to start trying out our apis, follow these steps get api credentials get access token (a bearer token) use access token st art calling our apis intro