API Documentation

Exporting Palette

Endpoints
Endpoint Description
GEThttp://savemypalette.com/api/export The URL to GET an exported palette
Endpoint Parameters
Parameter Required Type Default Description
GET id done String NULL Alpha-numeric. The URL ID of the palette. No spaces, alphanumeric string between 5 and 200 characters in length.
GET auth_key close String NULL Alpha-numeric. The key that needs to be sent to GET exported palettes that require a password.
GET type close String CSS Case-insensitive value for different export formats. Can be CSS, SCSS, SASS, JSON, XML, GPL
GET minified close Boolean Not Set Just has to be set. If this is set, then the result will be in minified form.
GET download close Boolean Not Set Just has to be set. If this is set, then the result will be downloaded for almost all formats.
Extra Notes
Title Description
Color names The shortened names are a lowercase version of the color's name, with "-" instead of " ". For example, a color named Bright Purple would be .bright-purple in css.
Examples
URL Description
GEThttp://savemypalette.com/api/export?id=rainbow-test Returns all colors for palette rainbow-test, in CSS, not minified, as long as it is set to "anyone can view"
GEThttp://savemypalette.com/api/palette?id=restricted-palette&auth_key=pass&minified&type=JSON Returns all info for palette restricted-palette. It is in minified JSON. Because it is restricted, an auth_key must be sent.
Response

      URL: GEThttp://savemypalette.com/api/export/?type=css&id=site-theme
      
1
/* No palettes found */
URL: GEThttp://savemypalette.com/api/export/?type=json&id=site-theme
1
No palettes found
URL: GEThttp://savemypalette.com/api/export/?type=sass&id=site-theme
1
/* No palettes found */
URL: GEThttp://savemypalette.com/api/export/?type=scss&id=site-theme
1
/* No palettes found */
URL: GEThttp://savemypalette.com/api/export/?type=gpl&id=site-theme
1
No palettes found

Getting Specific Palette

Endpoints
Endpoint Description
GEThttp://savemypalette.com/api/palette The endpoint to GET a palette.
Endpoint Parameters
Parameter Required Type Default Description
GET id done String NULL Alpha-numeric. The URL ID of the palette. No spaces, alphanumeric string between 5 and 200 characters in length.
GET auth_key close String NULL Alpha-numeric password. The key that needs to be sent to GET info on palettes that require a password.
GET pretty_print close Mixed NULL If this is set, the JSON will be printed non-minified
Response Codes
Code Description
200 Recieved request successfuly
401 auth_key is needed, but none was sent/recieved
404 Palette not found
Examples
URL Description
GEThttp://savemypalette.com/api/palette?id=rainbow-test Returns all info for palette rainbow-test, as long as it is set to "anyone can view"
GEThttp://savemypalette.com/api/palette?id=restricted-palette&auth_key=pass Returns all info for palette restricted-palette. Because it is restricted, an auth_key must be sent.
Response
      
    URL: GEThttp://savemypalette.com/api/palette/?id=site-theme
    
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
{
    "meta": {
        "errors": [],
        "request": {
            "date_sent": "2017-04-24 11:09:19",
            "data": {
                "GET": {
                    "id": "site-theme",
                    "pretty_print": ""
                },
                "POST": []
            },
            "response_code": "404"
        }
    },
    "data": {
        "errors": [
            "No results"
        ]
    }
}

Getting Random Colors Or Palettes From colourlovers.com

Endpoints
Endpoint Description
GEThttp://savemypalette.com/api/random/palettes The endpoint to GET random palettes.
GEThttp://savemypalette.com/api/random/colors The endpoint to GET random colors.
Endpoint Parameters
Parameter Required Type Default Description
GET num close Int NULL The number of results to return.
Examples
URL Description
GEThttp://savemypalette.com/api/random/palettes Returns 1 random palette from colourlovers.com
GEThttp://savemypalette.com/api/random/colors?num=30 Returns 30 random colors from colourlovers.com
Response
      
    URL: GEThttp://savemypalette.com/api/random/palettes
    
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{
    "data": [
        {
            "name": "Sleepless",
            "colors": [
                {
                    "value": "#BDB491",
                    "name": "gray?"
                },
                {
                    "value": "#BD9700",
                    "name": "out of sun"
                },
                {
                    "value": "#690042",
                    "name": "face 2 face"
                },
                {
                    "value": "#6600CC",
                    "name": "purple?"
                },
                {
                    "value": "#270061",
                    "name": "hidden here"
                }
            ]
        }
    ],
    "colors": [
        "BDB491",
        "BD9700",
        "690042",
        "6600CC",
        "270061"
    ]
}