Coder Social home page Coder Social logo

alsoservicepurchase's Introduction

Also Cloud Service Purchase

This is a mobile project that demonstrates how to create an application that integrates the Also Cloud SimpleAPI.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development purposes.

Prerequisites

React Native

Note: Follow the instructions for building native code in a project. The following should be the last command to complete this setup.

npm install -g react-native-cli

Android

Since this is a React Native project it works on both Android and iOS devices. But the project has only been tested on Android so we recommend this setup.

Note: As with React Native, follow the instructions for building native code in a project.

Installing

Clone the repo into your preferred directory.

git clone https://github.com/alsocloud/alsoservicepurchase.git

Run "npm install" and after that run "react-native run-android" inside the project folder

cd alsoservicepurchase
npm install
react-native run-android

Code Samples

The following samples are written in JavaScript using the Fetch API.

Non-Authenticated sample:

fetch(
  url: 'https://marketplacetest.ccpaas.net/SimpleAPI/SimpleAPIService.svc/rest/${endpoint}',
  {
    method: 'POST',

    headers: {
      'Accept': 'application/json',
      'Content-Type': 'application/json'
    },

    body: `${requestBodyJsonString}`
  }
)

Authenticated sample:

fetch(
  url: `https://marketplacetest.ccpaas.net/SimpleAPI/SimpleAPIService.svc/rest/${endpoint}`,
  {
    method: 'POST',

    headers: {
      'Accept': 'application/json',
      'Content-Type': 'application/json',
      'Authenticate': `CCPSessionId ${token}` // difference between authenticated and non authenticated requests
    },

    body: `${requestBodyJsonString}`
  }
)

All implementations of the Also Cloud SimpleAPI in this project can be found in the src/apis folder.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

alsoservicepurchase's People

Contributors

davifantasia avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.